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.
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. :)