3

Magento 2.3 integrated with Elasticsearch 5.2 provides search results similar to Mysql search in terms of relevance. For example a keyword Pink, search output is 126 items found both in Mysql and Elasticsearch.

Isn't elasticsearch supposed to provide more relevant results? When an extension like Wymoind or Amasty elastic search extension is added, then the results for Pink keyword narrows down and looks more relevant which results in 31 items.

Is this how it is supposed to work or am I missing something? I know for sure elasticsearch is working because when turn off the server and do a search, I get node not found exception.

2
  • After you change Magento’s Elasticsearch configuration, you must reindex the catalog search index and refresh the full page cache using the Admin or command line. Dec 24, 2018 at 10:45
  • Yes. I have done that.
    – Zoya
    Dec 24, 2018 at 18:34

2 Answers 2

3
+50

Magento 2.3 still use "OR" logic for mysql and elasticsearch. Plus "should" conditions (query to ES) are wrong. That's why relevance almost same. But ES significantly improve performance of search and catalog (layered navigation).

Mirasvit's ES is compatible with recent 2.3 and greatly improve relevance https://mirasvit.com/magento-2-extensions/elastic-search-ultimate.html

4

you have to set AND operator in your elastic search json queries, Override the module-elasticsearch/SearchAdapter/Query/Builder/Match.php. file in your custom module and then The code you have to edit in the build function in line no 75

if($matchKey != 'match_phrase_prefix'){$matchQuery['operator'] = "AND";}

Also make sure you are not setting the operator in match_phrase_prefix.

After this you'll get exact matches in catalog search.

This has been tested well for magento CC 2.4.0

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.