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.


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" />
  • Hi, I followed this and now the search synonyms are not working. If I add synonyms: read,rid then searching read or rid comes up with no result. Please help.! – ishu Feb 25 at 6:29

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.