2

I upgraded to 2.4.1 and elasticsearch, which I did not use before.

In my log I find the following error

"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true, "failed_shards":[{"shard":0,"index":"magento2_product_1_v4","node":"HVBmFhwfQK-VkdOPpT60-g","reason":{"type":"illegal_argument_exception", "reason":"Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [features] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}}], 

(this repeats 5+ times deep)

at vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:632

This seems to indicate it is not happy with the [features] attribute being a text field

Problem is, it is not a text field, it is a multiselect attribute with backend type varchar - I have just checked the attributes table to be sure! - so what is this error about? Also, I am not aware of aggregrating or sorting by that field anywhere, though as a multiselect field it is used in layered navigation. That's what they are designed for, no?

How should multiselect attributes be to work with layered navigation and elasticsearch?

1

I figured it out

This was a data migration caused bug, I should have remembered that data migration would incorrectly put the multiselect attributes in the text eav table not the varchar eav table - see https://github.com/magento/data-migration-tool/issues/646

I had copied my data to the right place but I had not cleared the wrong entries in the text eav table. Clearing these fixed my problem

2
  • But why such varchar as "name" (product name) can be searchable? – zhartaunik Jan 20 at 7:44
  • @zhartaunik varchars can be searched - it's text that causes bugs – iphigenie Feb 8 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.