Skip to content

“Text fields are not optimised” error in system.log but it’s NOT A TEXT FIELD

I am seeing the follwoing error in system.log files.

[2022-08-20 05:33:36] main.ERROR: {"error":{"root_cause":[{"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 [number_of_bowls] in order to load field data by uninverting the inverted index. Note that this can use significant memory."}]

This is one of the attributes that is giving the error: number_of_bowls

I researched on this error and found out that this attribute should not have backend type text saved in the database.
Reason why this would have happened is explained in the follwoing github issue.

https://github.com/magento/data-migration-tool/issues/646

Short explaination from above link why this would have happened:

In Magento 1 multiple select attributes are created with backend type text.
In Magento 2 multiple select attributes are created with backend type varchar.

Migrated multiple select attributes are migrated to Magento 2 with backend type text.
The migrated attribute data is therefore in a different table, catalog_product_entity_text
rather than catalog_product_entity_varchar.

So this issue occurs during migrating from M1 to M2.

But now my question is that my attribute does not have any problems as listed above. It has all the data in the proper tables and also the backend type is set to int and also it is not a multiple select attribute but a select attribute.

But still I am getting this issue for the above attribute. Could any one suggest why it is happening if everything is fine in my attribute’s case.

Screenshot of the attributes’s data just to be sure that it has everything as expected in the database.

Screenshot from eav_attribute table

enter image description here

Also its data is saved in catalog_product_entity_int table

enter image description here

And the value for this attributes in eav_attribute_option_value table
enter image description here

So now you guys can see that this attribute does not have any wrong settings but still it is giving me this error. Could someone guide me why this could be happening as I could not find anything regarding this.