I am trying to create a Facet system using an array of tags.
JSON.SET group:1 $ '{ "tags": ["tag1"] }'
JSON.SET group:2 $ '{ "tags": ["tag1","tag2"] }'
FT.CREATE groupIdx ON JSON PREFIX 1 group: SCHEMA $.tags.* AS tags TAG
FT.AGGREGATE groupIdx "*" GROUPBY 1 @tags
The expected result is:
tag1 → cnt: 2
tag2 → cnt: 1
But I am getting only
tag1 → cnt: 2
I suspect the AGG is considering only the first item from the array.
Is there any way to achieve the expected result?