4

I have 4 products in catalog with names:

aaa

bbb

aaa-bbb

aaa_bbb

When I try to search "aaa", I get aaa, aaa-bbb and aaa_bbb products as a result (screen 1) screen 1

When my query is "bbb", I get only bbb and aaa-bbb (screen 2) screen 2

"aaa-bbb" query gives me all my products (screen 3) screen 3

And finally query "aaa_bbb" returns me only one product (screen 4) screen 4

So, can you please explain me how it works and how I can change this logic? Specifically, I need to get only aaa-bbb product, when I search "aaa-bbb".

Did I understand correctly, Magento search engine explode my query by '-' symbol? I didn't found the confirmation of this in code, but as I see by search results it's looks like true.

Thank you for attention :)

  • Illia, did you find a solution for this problem? – Omitri Jul 17 '18 at 11:26
  • 1
    @Omitri, unfortunately not. But i decided to use elasticSearch engine on my project. – Illia Arefyev Jul 18 '18 at 9:34
5

Magento by default using MySql based search. So, it is split text on word on by pattern like [^a-z0-9_]. it's why aaa-bbb interpreted as "aaa bbb"

see more details here: http://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html

  • how can i change this pattern? – Illia Arefyev Dec 3 '16 at 9:23
  • as I known it is possible only with recompilation or custom parser plugin, but you can implement it with text preprocessing on Magento side – KAndy Dec 3 '16 at 19:56

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.