2

I need to be able to search by partial string of a SKU, for example, if a SKU of a product is "CUS123.5NYS" the customer may also be able to search by "123.5N", but currently, it only works if I search by initial or end part of the string.

Is it possible to allow search by partial string using some interceptor or preference to override a class?

In the Store configuration I'm using Elasticsearch 5.0+ as Search Engine

1 Answer 1

2

By default magento doesn't use wildcards (*123.5N*) with ES. Query building logic implemented in class Magento\Elasticsearch\SearchAdapter\Query\Builder\Query (need change query type to query_string).

1
  • 1
    can you elaborate the way,in case i have sku 4005S66Almina and i want to search Almina how to do this? Oct 29, 2020 at 7:54

Your Answer

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

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