StackExchange / NRediSearch

Other
31 stars 9 forks source link

Not In query : In search #25

Open yashhema opened 2 years ago

yashhema commented 2 years ago

Hello, How to do query with Not in operator : say I what to run query where country not in brazil or australia

Query q = new Query($"(@name:{ abc })|(@address:{ cdd })|(@country:-(BRAZIL | AUSTRALIA)")

right now - operator gives error

slorello89 commented 2 years ago

@yashhema - sort of hard to say for sure without seeing what you are using to create the index. A query like

FT.SEARCH test "@country:-(Brazil|Australia)"
1) (integer) 2
2) "test:1"
3) 1) "country"
   2) "america"
4) "test:2"
5) 1) "country"
   2) "uk"

Will work if country is a TEXT index - so it could be the index types you are using?