Algolia is ignoring all text before hyphen

Hi Team,

Is algolia ignoring all text before the “-”?

For example:

Case 1:
Typed word in the search box: hp
The following results are returned by algolia
HP1525P /A V2
HP1527P /A V4
HP1527P /I V2
HP1827P /A V4

Case 2:
Typed word in the search box: hp-226
The following results are returned by algolia
KTEB-2261TPSC
KTEB-226 TUVTPPSDNL
KTEB-226UVPSDW

Can you please explain why case 2 is not displaying the results which it starts with the letters “hp”?

Instead of “hp” , it only considers the “-226” ?

I think the algolia should return results in both scenarios (hp and 226 ).

Can you please explain ?

Hi @jayashreen,

In Algolia, ‘-’ is considered a separator, meaning that if you search for hp-226, the engine will search for “hp 226” as if it was two words.

Do you have the removeWordsIfNoResults parameter set to “FirstWords” or “All optional” ? If so, if no record match the query “hp 226”, the engine will return the results for the query “226”.

If you would like to force the engine to search for “hp-226” literally, you can set “-” as a separatorsToIndex.

If you are having a relevance issue that you would like us to debug with you, you can also give us access to your Algolia dashboard here: https://www.algolia.com/account/support. In that case, please send us an email @ support@algolia.com mentioning this thread, your app ID and index name, as well as:

  • an exemple of a query with parameters you are testing,
  • the results you get,
  • the objectID of the first 5 results you would expect to get instead.

With this, we will be able to give you aa more specific answer.

Happy New Year 2020!