InstantSearch.js reset Query rules on search

I created a products carousel with a search function to display trending products. But found a problem when others decided to use Query Rules from the dashboard to stick 7x products based on product id as default results.
Is there a way to reset Query Rules when someone searches for products?

At this moment when someone uses search, those 7x products are kept at the very beginning of list. It breaks carousel functionality as you need to scroll to see other products.

I’m looking for a way in InstantSearch.js to reset Query Rules on the search and display what the user wants. In that case, I want Query Rules to be available only on the initial load.

Does anyone have a suggestion about that? Tried to search doc but couldn’t find anything.

Any chances that anyone can help on how to overwrite Query Rules set in the dashboard? But overwrite them when someone types anything in search and then Query Rules will be overwritten with results? So it keeps Query Results on first load but skip them when you search

Maybe anyone from Algolia tech team can help? @haroen ?
Thanks in advance.

Let me get my head around this.

You want your rules to have an effect on what is shown by default, but as soon as someone starts performing a search, you want those rules ignored so the most relevant product(s) fitting the user’s search show up first?

Have I misinterpreted?

Basically yes, you’re correct.

At this moment Query Rules set in Algolia Dashboard have an effect on what is shown by default. But I want to ignore them when someone starts to search for something new.
They can have effect on initial results when page is loaded but problem I have how to ignore them when someone start searching for something different.

Hey @FunkyRobster ! If you’re looking to only have a Rule take effect on empty queries, you’ll want your condition to be “query is” and then leave the input empty. It’ll look like this in the Manual editor:

And once you’ve created it, it’ll look like this in the list of Rules:

Hope this is what you’re looking for!

1 Like

Hi Maria. Thank you for your message.
I forgot to mention something important and realize that when you replied.

But looks like the problem is solved. Don’t remember exactly what was the latest setting but it didn’t work when we had set filter.
It may be due to the fact previous setting if remember was search contains or starts with instead of is.

Thank you