Sorry if I was being confusing, but we are trying to merchandise products - we have no functionality regarding search for collections/pages. We’re tying to mirror the functionality of a Shopify collection (similarly to how the Algolia Shopify plugin can replace your collection pages with an instant search instance) page but leveraging Query Rules to manually merchandise products. My reply was asking about the difference between you’re
searchFunction approach and simply adding the query to
After some testing it appears that your code using the
searchFunction does not play nicely with some of the instantsearch.js connectors/widgets. For example, it breaks our showMore button (using a connector).
Adding the query to
searchParameters seems to work consistently.
There’s one big issue we’re still having, and that is promoting the products causes duplicates, regardless of Distinct settings.
Meaning, if a search would have returned a product anyway, but that product was also promoted to the top, that product will be in the results twice. As a work around, I have done some JS array filtering to deduplicate entries in the
hits array based on product handle. But now this is screwing up the number of results returned. If I ask for 15 results per page, but 2 of them were duplicates, I really have 14.
As you might imagine, this could spiral if not kept track of.
Is there anything to do about these issues? Its pretty unfortunate that theres no true way to merchandise collections with Algolia.
Here’s another post I found from a user with seemingly the same issue.