I've setup Elasticsearch on magento and when trying to search by any string I'm getting an error

illegal_argument_exception: Invalid format: "search string"

I found out that when I removed all datetime attribute I've got another error

number_format_exception: For input string: "search string"

And I understand that now something wrong with int type attributes

When I'm searching by int everything is ok, result is there.

My suggestion - Elasticsearch created incorrect mapping (I didn't created it by hand it was done automatically after reindex products) but I wonder how to check this to be sure. Or have I ability to setup my own mapping.

4 Answers 4


Most likely one of your int or decimal attributes is searchable. Try to find them by using the following SQL query:

SELECT * FROM eav_attribute e
LEFT JOIN catalog_eav_attribute cea ON e.attribute_id = cea.attribute_id
WHERE e.backend_type = 'decimal'
AND cea.is_searchable = 1
AND e.frontend_input != 'price';

If you find decimal attribute which is searchable try to make it as Not Searchable

  • Go to admin -> store -> attributes -> product -> find the attribute
  • Edit attribute and make it NOT Searchable
  • Run full reindex php bin/magento index:reinde catalogsearch_fulltext

I had the same problem with search string. With ES 2.4.6.I solved it change property of an attribute datetype to NOT use in search. I saw that there is an issue with date maping (when searching by string)


This issue may occurs when you are using an older version of Elastic search. For example Magento 2.3 comes with Elasticsearch and Elasticsearch 5.0+ versions. You must have elasticsearch 5 installed as engine and select the Elasticsearch 5.0+ as search engine in Magento admin.

Furthermore as of time of writing I have found out that Elasticsearch 6 doesn't cope well with Magento. Elasticsearch 5 is fine.


Check the detail and fix shared by the Magento support here - https://support.magento.com/hc/en-us/articles/360027356612-Elasticsearch-5-is-configured-but-search-page-does-not-load-with-Fielddata-is-disabled-error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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