Adding random sort on FT.SEARCH


Do you have any plan to add a random sort on FT.SEARCH?

Currently, there is a REDUCE RANDOM_SAMPLE on AGGREGATE but aggregate does not return document ids unless document id is duplicated in a new sortable document field.

Thank you.

1 Like

I’m currently looking for creating my own scoring function.


Can you please describe your use-case a little more, maybe we can come up with a solution to what you need.

Thank you Meir.

Let’s suppose that I have indexed all world cars.

I would like to return car suggestions to a user who is interesting about diesel and hybrid engine.

FT.SEARCH cars "@engine:(diesel|hybrid)" LIMIT 0 10 (SORTBY RANDOM?)

Suggestions should be different for each page reload and ideally support pagination.

I’m currently using Solr (which support random sorting with pagination) and I would like to migrate to Redisearch.

Solr random sort documentation:


1 Like