Redis FT.AGGREGATE FILTER in NUMERIC array

34 views Asked by At

I have below redis JSON dataset:

[{
    "t": "Global",
    "reg": "world",
    "kikplrs": [
        2882,
    ],
    "id": 1498
},{
    "t": "Global",
    "reg": "world",
    "kikplrs": [
        1500
    ],
    "id": 1498
},{
    "t": "Multi",
    "reg": "world",
    "kikplrs": [
        2888
        2882,
    ],
    "id": 1498
},
]

I want to fetch (using FT.AGGREGATE) all records WHERE kikplrs[] contains '2882'. I have indexed: FT.CREATE idx:JoinMe ON JSON PREFIX 1 doc:rg: SCHEMA $.id as id NUMERIC SORTABLE $.reg as reg TEXT $.t as t TEXT $.kikplrs as kikplrs NUMERIC

So far i have tried below: FT.AGGREGATE idx:JoinMe * LOAD 5 @__key id reg t kikplrs FILTER "@kikplrs==[2882]". But didnt work.

FILTER with @reg and @t is working with dataset. But with @kikplrs i am getting "1" in return.

0

There are 0 answers