magento2: Magento 2.2.6 Searching for product with dash doesn't work

Preconditions (*)

  1. Magento 2 version 2.2.6

Steps to reproduce (*)

  1. In “vendor/magento/module-catalog-search/etc/search_request.xml” change
<query xsi:type="boolQuery" name="quick_search_container" boost="1">
    <queryReference clause="should" ref="search" />
    <queryReference clause="must" ref="category"/>
    <queryReference clause="must" ref="price"/>
    <queryReference clause="must" ref="visibility"/>
</query>

to

<query xsi:type="boolQuery" name="quick_search_container" boost="1">
    <queryReference clause="must" ref="search" />
    <queryReference clause="must" ref="category"/>
    <queryReference clause="must" ref="price"/>
    <queryReference clause="must" ref="visibility"/>
</query>

So that the search query “blue boot” only shows products with both the words. 2. Add a product in the back-end with a name with a dash (-) in the name. For instance “Lakboot Black Mat New A-327 N118” in my case 3. On the frontend search for that product. So with my example you would search for “A-327”. 4. Now when you have the search clause for must nothing is going to show up.

Expected result (*)

  1. You would expect the product to show up

Actual result (*)

  1. There are no results found

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 40 (2 by maintainers)

Most upvoted comments

@DeLuuk i will recheck it deeper this may be related to minimal search words, but anyway i’m will reopen this if have no solution and this caused by magento

@DeLuuk in centOS this file in -> /etc/my.cnf add after [mysqld]

innodb_ft_min_token_size=2
ft_min_word_len=2