How can i get random item from algolia?

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.

How did you figure out about the shuffle: true option of index.search()? It is not in the documentation :smiley: !
Your example link however doesn’t send us anywhere relevant.

Where do you see this Shuffle: true ?