-
Notifications
You must be signed in to change notification settings - Fork 341
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
Bad SQL query to init EAV attributes #2769
Comments
Hi Dmytro! We need more details about your Elasticsearch server like whether it's Elasticsearch or Opensearch, which version you are using, and where it is hosted (AWS, Magento Cloud, etc). It seems that your issue could be linked to the mapping settings, including a strict type for BR, |
hi @vahonc, We are using elasticsearch version 7.6.0. Project hosted on hypernode. We were able to reproduce issue on every dev instance we had within our team. May be there is a strict mapping setting. But bad query generated and this is not affected by elasticsearch settings in any way. |
For me the |
Could you check if my fix solved your problem? BR, |
Indexer fails to index any product. Elasticsearch throws numerous errors like
[2022-11-02T21:28:12.551967+00:00] report.ERROR: Bulk index operation failed 1 times in index gc235_saaf_catalog_product_20221102_212751 for type _doc. Error (mapper_parsing_exception) : failed to parse field [status] of type [boolean] in document with id '20874'. Preview of field's value: '1'. Failed doc ids sample : 20874. [] []
these errors generated for every product.
Preconditions
Magento Version : Commerce 2.4.5
ElasticSuite Version : 2.10.12
Third party modules : Plumrocket GDPR
Steps to reproduce
Install any custom extensions which adds its own eav entity type and attributes with same codes as we have for product but with different type. For example products status attribute treated by ElasticSuite as int. On other hand "Display Checkbox" attribute from Plumrocket GDPR extension has same code
status
but source model is Magento\Eav\Model\Entity\Attribute\Source\Boolean so it is treated as a boolean.Expected result
Actual result
Error (mapper_parsing_exception) : failed to parse field [status] of type [boolean] in document with id '20874'. Preview of field's value: '1'. Failed doc ids sample : 20874.
Problem in how ElasticSuite generates query to fetch all attribute for index. Root cause is in
\Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Datasource\AttributeData::addIndexedFilterToAttributeCollection method when we add OR condition for
status
andsku
attribute code. Resulting query looks likeand in result we try to index
status
attributes from different entity types.The text was updated successfully, but these errors were encountered: