Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: no mapping found for field [search.whitespace] #3306

Closed
Playhf opened this issue Jun 26, 2024 · 7 comments
Closed

Error: no mapping found for field [search.whitespace] #3306

Playhf opened this issue Jun 26, 2024 · 7 comments
Assignees

Comments

@Playhf
Copy link

Playhf commented Jun 26, 2024

Hello we're having an issue after reindex and trying to load category page:
Exception #0 (OpenSearch\Common\Exceptions\BadRequest400Exception): {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_idegaarden_catalog_product_20240626_081350","node":"P_6BnSxbQVeVPqVHIMnQdA","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}}},"status":400}

Magento Version : 2.4.7
ElasticSuite Version :2.11.7. Along with hyva-themes/magento2-smile-elasticsuite:1.2.4.

Steps to reproduce

  1. Install hyva-themes/magento2-smile-elasticsuite:1.2.4
  2. php bin/magneto indexer:reindex
  3. Go to category page.

Expected result

  1. Plp loads without any errors.

Actual result

  1. Error message in developer mode.
Screenshot 2024-06-26 at 11 35 33 2. Error log in production mode `[2024-06-26T07:45:23.510017+00:00] main.CRITICAL: OpenSearch\Common\Exceptions\BadRequest400Exception: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"magento2_idegaarden_catalog_product_20240626_073206","node":"ZE04yHunSeieHGsMMVAP9A","reason":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}}],"caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]","caused_by":{"type":"illegal_argument_exception","reason":"no mapping found for field [search.whitespace]"}}},"status":400} in /home/id-dev/releases/20240626-092820/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php:664 Stack trace: #0 /home/id-dev/releases/20240626-092820/vendor/opensearch-project/opensearch-php/src/OpenSearch/Connections/Connection.php(328): OpenSearch\Connections\Connection->process4xxError() #1 /home/id-dev/releases/20240626-092820/vendor/react/promise/src/FulfilledPromise.php(28): OpenSearch\Connections\Connection->OpenSearch\Connections\{closure}() `

Technical information

In the search request object \Smile\ElasticsuiteCore\Search\Request\Query\Filtered in query property i can see*Smile\ElasticsuiteCore\Search\Request\Query\MultiMatch*fields array with following fields:

  1. search.whitespace
  2. name.whitespace
  3. sku.whitespace

In admin panel i found a mapping for both name and sku and i can see whitespace is defined there.
The same can't be said about search.whitespace.
Screenshot 2024-06-26 at 11 40 18

Please assist me with this issue.
Thanks

@Playhf
Copy link
Author

Playhf commented Jun 27, 2024

@vahonc could you please participate?

@Playhf
Copy link
Author

Playhf commented Jun 28, 2024

@romainruaud if you have any experience with such in issues as well I would really appreciate your help.

@rbayet
Copy link
Collaborator

rbayet commented Jul 1, 2024

Hello @Playhf,

Could you copy/paste either your full mapping or at least the section relative to the "search" (multi) field ?

Regards,

@Playhf
Copy link
Author

Playhf commented Jul 2, 2024

Hello @rbayet yes, here is the mapping for catalog product index.
catalog_product_index_map.txt

@romainruaud
Copy link
Collaborator

Any chance you might be having an attribute named "search" ?

@rbayet
Copy link
Collaborator

rbayet commented Jul 2, 2024

Any chance you might be having an attribute named "search" ?

Yes, looking at the mapping, I can see that

  "search": {
    "type": "text",
    "fields": {
      "standard": {
        "type": "text",
        "analyzer": "standard"
      }
    },
    "copy_to": [
      "search",
      "spelling"
    ],
    "norms": false,
    "analyzer": "keyword"
  }

That's typical of a searchable text attribute whose attribute code is indeed "search" and our magic "search" is not present, whose mapping should be

  "search": {
    "type": "text",
    "fields": {
      "shingle": {
        "type": "text",
        "analyzer": "shingle"
      },
      "whitespace": {
        "type": "text",
        "analyzer": "whitespace"
      }
    },
    "analyzer": "standard"
  }

Copy link

This issue was waiting update from the author for too long. Without any update, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants