Skip to content

Magento 2.2.6 Searching for product with dash doesn't work #21059

Closed
@Luuk-Meijer

Description

@Luuk-Meijer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions