Merchandizing Shopify Collections to promote specific hits

Hi Algolia, I’m trying to promote a specific hit to the top of my Shopify Collection. I have followed this advice: Use the Manually sorting order from Shopify but I’m unsure why it’s not working… I’ve added the snippet and tried all kinds of different query combinations on the algolia dash trying to get it to show… Nothing seems to work. Is there anything I can do in this case?

My Algolia dash looks like:

Here’s my algolia_instant_search.js.liquid snippet:

Also it should be made clear that the client in this case doesn’t want a search bar shown on the collection page, so the query rule would need to be applied on initial load.

Hi @sean,

The algolia_instant_search.js.liquid modification you’ve made is correct - it’ll supply the collection name as the context when performing searches on collection pages.

As for the query rule:
we need to keep in mind that for the search triggered on initial load, the query text will be empty.
So, a query rule targeting the initial search will be one where the query is blank.
You will need to modify the query rule you’ve created to target a blank search.

And to make it work for a specific collection, you will need to set another property called “context”.
I see that you’ve already done this step though.

To summarise, you will just have to create a query rule with the following properties:

  1. Context: the collection name has to be specified as the context
  2. Query: for the query section, set the selector to “is” and the text field as blank

Attaching an example query rule for a collection called “expensive-products”:

This is what the query rule should look like in the list:

Let me know if I can help with any further clarifications!


Thanks for your reply @praagya.joshi, everything worked great. In our case however, this does result in duplicate hits for these promoted products. Since this client is big into merchandizing specific collections, the fact that he has to manually promote a product and then hide all of the variants of that product is quickly becoming unsustainable for him:


Is there some logic I can add to the query rule to get around this?

Hi @sean,

Thanks for reaching us.

Could you please reach to us at regarding this duplicates issue?

We do provide a feature (that we enable manually) that will fix the duplicates issue automatically (without having you creating “hide variants” Query Rules).
We will give all the information about this feature by replying to your mail.


1 Like