Search for "SA-241" not showing first

We have a product that is named “SA-241”. When the user searches for “SA-241”, this doesn’t show up for 7 pages. But a product with “SA-2419-DTI-PK” shows up first.

Is there some kind of criteria we can do to set it to show the “SA-241” first?

Hi there,

Indeed, for the query SA-241, records holding exactly SA-241 or holding SA-2419-DTI-PK will be considered equal by default in Algolia because of prefix matching.

In this case, you should be able to tweak this behaviour by setting exactOnSingleWordQuery to word: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/

I’m surprised that the record holding exactly SA-241 would be as far as 7 pages behind though. Is the attribute holding the string SA-241 high in your list of searchable attributes? You could try to lift it higher up.
More on why the order of searchable attributes matters here: https://www.algolia.com/doc/guides/managing-results/must-do/searchable-attributes/#ordering-your-attributes.

Thanks, Marie. I’ll check it out!

1 Like