Search Query: FT.search logIndex "@country:{Brazil}"
return 3 user_id timestamp country
Returned Values:
instead of country Brazil it is returning the data of China.
I did not find any solution to this problem or may be I am new to RediSearch.
Search Query: FT.search logIndex "@country:{Brazil}"
return 3 user_id timestamp country
Returned Values:
instead of country Brazil it is returning the data of China.
I did not find any solution to this problem or may be I am new to RediSearch.
Does the record returned have multiple values for the country? If so, I am told that earlier dialects of RediSearch will only return the first one in the list even though it matched another value. You might want to try using
DIALECT 3
when you callFT.SEARCH
and see if that helps.Also, you can probably improve your schema:
I'm guessing
user_id
probably has values likegroyse
,hchandani
, orjamesz
.TEXT
fields are for sentences and paragraphs of human-readable text. I'm guessing this would not describe auser_id
. It might work better as aTAG
.If you convert
timestamp
to an UNIX Epoch datetime (in seconds), store it in your JSON as a number, and index it asNUMERIC
then there are date functions when callingFT.AGGREGATE
that you can take advantage of.I would convert it to this:
This doesn't solve your problem above, of course. It's just some extra unsolicited advice! ;)