I am develop a quiz aplication and i use algolia for filter question by specialies.How can i randomize my results.I think when i filter my questions by algolia for 20 items every time i will get same result.Is there any way get random items at server side.
Hi @zgrsln34 –
Nope, we’re designed for search, so randomization is outside our scope.
But there are some tricks you can with ranking to randomize results – you can influence sort order by injecting a new attribute into your records. This is a pattern we use for injecting external popularity or review scores for sorting. In your case you would just inject a random number on each record and update them at intervals.
Otherwise you’d need to do the randomization on the client side.
I’ve run into a bit of a roadblock when it comes to achieving randomized question sets. It seems that every time I filter questions for a specific specialty, I end up with the same set of questions in the same order. This predictability takes away from the engaging experience I want to offer users. I’ve tried exploring sitework estimating services different options within Algolia, but I’m not sure how to implement server-side randomization to ensure that users receive a fresh and diverse set of questions each time they access a specialty.
How did you figure out about the shuffle: true
option of index.search()
? It is not in the documentation !
Your example link however doesn’t send us anywhere relevant.