Redisearch: FT.AGGREGATE sortby DESC not working

Created on 21 Jul 2020  路  2Comments  路  Source: RediSearch/RediSearch

Redis. 5.0.8 and Redisearch (Git=v1.6.6-83-gcdb8cd4f)

this works, results is by ascender order. (default).
FT.AGGREGATE index 'bar' FILTER 'exists(@b)' GROUPBY 1 @b REDUCE count 0 as 'foo' SORTBY 1 @foo

This does not work:

FT.AGGREGATE index 'bar ' FILTER 'exists(@b)' GROUPBY 1 @b REDUCE count 0 as 'foo' SORTBY 1 @foo DESC

FT.AGGREGATE index 'bar ' FILTER 'exists(@b)' GROUPBY 1 @b REDUCE count 0 as 'foo' SORTBY 1 @foo ASC

Both lead to : (error) Unknown argumentDESCat position 14 for <main>

I think there is a bug with FT.AGGREGATE SORTBY.

help wanted

All 2 comments

The DESC/ASC is considered an arguments of the sortby so you specify 2 arguments to the sortby:
SORTBY 2 @foo DESC

Thank you. I was wondering what the number was for. :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahemoff picture mahemoff  路  4Comments

dme-development picture dme-development  路  8Comments

luistrigueiros picture luistrigueiros  路  6Comments

ethan-tr picture ethan-tr  路  8Comments

yansuihehe picture yansuihehe  路  5Comments