I’m using Redisearch and RedisJSON and I have this object type
{
"Id": "string",
"Locked": "string"
}
I have this index
FT.CREATE idx ON JSON PREFIX 1 "queue:" SCHEMA $.Id AS Id TAG $.Locked AS Locked TAG
I’m trying to find objects where Id
is NOT equal to hello-world
and Locked IS “false”.
I’m attempting to do that with this command
FT.SEARCH idx "-@Id:{hello\-world} @Locked:{false}"
But the results are completly wrong, in fact it returns every object regardless of if their Id is NOT equal to the one specified in the query and if Locked is false.
However I’ve found that by swapping Id and Locked the results are correct which got me thinking that the NOT operator applied to Id
is negating the whole query.
Am I doing something wrong or is this intended behavior? The workaround is fine but what if I need to search with two negative queries?