I have created an index on RediSearch that includes multiple fields, for example param1 and param2.
I perform the search using FT.SEARCH executing the following command.
FT.SEARCH "index" "@id:{4555bcbd\\-1d15\\-46f1\\-9acb\\-91e29c1f63f5} @param1:{ee2aa256\\-5c67\\-42cb\\-871f\\-a402fcdf2160}" "SORTBY" "param2" DESC LIMIT 0 3000
The search produces a list of objects. When I update for example param2 and execute the above command, the list changes. The latest updated object appears at the top of the list.
I tried to use multiple sorting fields but FT.SEARCH does not support sorting by multiple fields.
My custom solution included adding a
indexfield for every object I store. Then, useFT.AGGREGATEfunction to query and sort by multiple fieldsparam2andindex. Because in constract toFT.SEARCH,FT.AGGREGATEsupports multiple field sorting.