Skip to content

How to enable “exact” search in Magento 2 admin

I have a setup with Elasticsearch and Magento 2 (ver. 2.4.3). Anytime I use search functionality in Magento Admin (Catalog -> Products), the results are not exact.

It doesn’t matter if I use Keyword Search or if I open filters and write the query into the Name field, the results aren’t exact.

For example; This is my admin backend inside Filters dropdown.
enter image description here

The problem is that I am getting products with titles like “g96“, “g9“, “abcg9“.

I want to only find products that have “g9” in the title.

I understand the problem is with the way Magento processes fulltext queries, but how can I get the exact results. Even if I don’t use keyword search (which would probably search also in other attributes, like description) and I only use the “Name” field it still doesn’t work.

I’ve tried to change clause inside search_request.xml from should to must but to no avail.

...
    <queryReference clause="must" ref="search" />
    <queryReference clause="must" ref="partial_search" />
...