I am using Algolia instantsearch.js to display candidates to an election (here: https://laprimaire.org/candidats/). I would like the initial display of candidates to be random so that every candidate gets more or less the same visibility.
I read in this answer that it is not a feature of Algolia but that it should be possible to do it anyway with a little js trick : Is it possible to sort randomly, and to query on field if it exists?
Problem is I am using instantsearch.js and I cannot find how to implement the above searchFunction in the case of instantsearch.js.
I see from the documentation that instantsearch can be initialized with a searchFunction which receives a helper as a parameter: https://community.algolia.com/instantsearch.js/documentation/#initialization
However it did not find documentation about this helper and how to manipulate it, so that I can apply the random function to the search results.
Any help would be greatly appreciated ! Thanks a lot
Thibauld