Query search: Match specific attribute value only if value is matched exactly


we search in multiple attributes like modelName, brandName, stockId and so on. There is a problem if we search for a query BMW 5, it finds any BMW that have number 5 in stockId string.

Is there any way to configure specific attribute to only be matched if whole word of a query is equal to that attribute value (e.g. stockId)?


By => disablePrefixOnAttributes

"hello world" example (Dashboard).

The data:

The attributes:

The search

The solution

dashboard >>> configuration >>> prefixing >>> Disable prefix on attributes

This setting is useful on attributes that contain strings that should not be matched as a prefix (for example a product SKU).





Test again the search:

Search the exact sku return item :slight_smile:

For name:

If you add this to the name for example. Only exact word matching will return a value.

1 Like

It works! :tada: Thank you very much for extensive example and solution :slight_smile:

1 Like