1

In Magento 1 there was a configuration option to choose alternative options for the search function, how would I go about achieving an 'AND' operator for searches in Magento 2?

The current default appears to be 'LIKE'. So if I search for 'Nike Trainers' I'll get all Nike trainers, all trainers and all Nike products.

3

create a file search_request.xml in your module's etc folder ,

copy the entire node from vendor/Magento/CatalogSearch/etc/search_request.xml

and change

<queryReference clause="should" ref="search" />

to this

<queryReference clause="must" ref="search" />

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.