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:
Context: the collection name has to be specified as the context
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!