I'm in the midst of exploring RediSearch and I thought I'd give the aggregations feature a shot and have hit a roadblock.
I can't seem to get a good result.
For testing purposes I created a basic index/schema like so:
FT.CREATE test SCHEMA field TEXT
FT.ADD test 1A 1 FIELDS field hello
FT.ADD test 2A 1 FIELDS field hello
FT.ADD test 3A 1 FIELDS field hello
FT.ADD test 4A 1 FIELDS field world
Next, I issued the following query:
FT.AGGREGATE test "*" GROUPBY 1 @field REDUCE COUNT 0 AS agg
My expectation was that I get a result indicating hello
occurs three times and world
occurs once... but instead I get the following result:
1) (integer) 1
2) 1) "field"
2) (nil)
3) "agg"
4) "4"
I thought it was pretty straight forward... but I'm obviously doing something wrong.
Also, the following is the output from the MODULE LIST
command:
1) 1) "name"
2) "ft"
3) "ver"
4) (integer) 10300
2) 1) "name"
2) "ReJSON"
3) "ver"
4) (integer) 10001
Any help would be super.
Thanks!