I use Algolia instantsearch.js to show candidates for elections (here: https://laprimaire.org/candidats/ ). I would like the initial run of candidates to be random, so that each candidate gets more or less the same visibility.
I read in this answer that this is not a feature of Algolia, but that it should be possible to do it anyway with a little trick js: Is it possible to sort randomly and query in the field if it exists?
The problem is that I am using instantsearch.js and I cannot find how to implement the above search function in case of instantsearch.js.
The documentation shows that instantsearch can be initialized using the search function, which receives an auxiliary parameter as a parameter: https://community.algolia.com/instantsearch.js/documentation/#initialization
However, he did not find documentation about this assistant and how to manipulate it so that I could apply a random function to the search results.
Any help would be greatly appreciated! Thank you very much
Thibauld
source share