How to exclude search terms from all searches

Hi, we are coming across a problem with particular searches. We list only one type of product (phones), and so when people search:
Samsung
They get the samsung page, which is called “Samsung” (not “Samsung phones”) - this is perfect.

When they search
Samsung phones with 64gb ram
they get the “64gb Samsung Phones” page - also perfect.

The problem lies in them searching
Samsung Phones
as it will take into account “samsung” AND “phones”, and then return all the pages with both of those words in it (storage pages, ram pages etc etc) - but it will not return the “Samsung” page, because it doesn’t have “phones” in the name.

Is there a way to ignore/exclude the word “phones” from all searches? I have not found this yet.

Thanks

Hi Sebastian!

Thanks for your question. In the Indices section of the dashboard, you can set “Optional Words” under the Ranking tab towards the bottom.

Go ahead and add “phones” in there and you should be set.

Hi,

I have added it, but still am getting the results
“Samsung” -> Samsung page shows up first (perfect)
“Samsung phones” -> Samsung phones with 64gb shows up first, as it has a higher relevance, I am guessing due to more words matching.

There is no way to “ignore” or exclude the words?

edit: or even add words to the “stop words” list?

HI Sebastian,

So I can ensure I’m giving you the best assistance, I want to start by ensuring I know precisely what you’re seeking to accomplish.

Are you asking if there’s a mechanism to remove “phones” from a query, even if the user explicitly has “phones” in the query?

So, if a user were to enter in “samsung phones” as a query - Algolia would only query and return results for “samsung” in this case?

If this is your question, the answer is no, currently Algolia doesn’t allow you to specify your custom set of query words.

-Jason

Hi Jason,

thanks for replying.

Just to clarify; yes, that is essentially what I am after, that whenever someone types “phones/phone” in the query, that this certain word would be ignored.

User types: “Samsung Phones”
Algolia searches for: “Samsung”

And it looks like this isnt available, so would mean that we would need to update our indexes from what I understand to remove these word/s.

Yes. This behavior and custom stop words aren’t available with Algolia.

Hey Sebastian!

I wanted to update this thread. Have you seen Query Rules just yet? Now you can have stop words and other added pieces of functionality as well.

Cheers!
Jason

1 Like

Using query rules. Is it possible to remove all occurrences of a “-” dash from a search?