Difference Between AND/OR Match Modes in Magento Search

What's the difference between Match Modes AND/OR?

Elastic Search module provides a possibility to configure different search modes depending on the search attribute. With a suitable configuration, you can boost the relevance of the search results. In simple words, match mode (or search mode) is how the module handles the search request and what results are considered relevant.


In the module, there are two available match modes: AND and OR. You can set them for each search attribute individually in Stores → Configuration → Amasty Extensions → Elastic Search → Catalog → Search Query Settings.



The difference between the modes is in the way how the search query is being processed. For the AND match mode, the search results should have the exact match with the search query. Between two keywords it results in a search for products containing both of the words. For instance, the search sports equipment will retrieve all products that contain both words. 


Example returned products: bag for sports equipment, sports equipment for gym, sports essentials and gym equipment.


Match mode OR has a bit different behavior as it will return any products that contain at least one of the search terms. The same search sports equipment will retrieve products that contain either word.


Example returned products: tennis equipment, sports bag.