I am using Azure.search.mocument.models.SearchOptions and I’m trying to set the filter to not(answer in ('X', 'Y'))
. So it looks like this:
SearchOptions searchOptions = new SearchOptions()
.setFilter("not(answer in ('X', 'Y')");
What I’ve tried:
- not answer in (‘X’, ‘Y’)
- not(answer in (‘X’, ‘Y’)
- answer nin (‘X’, ‘Y’)
Also, .setFilter("answer eq 'X')
works just fine.
I get this error when doing the first two filters (not the “nin” one):
Invalid expression: Expression contains an unsupported OData language feature.
But in the Azure Search documentation, it says that “not” is supported: https://learn.microsoft.com/en-us/azure/search/search-query-odata-logical-operators
Is there any way I can do a “not in” expression rather than doing an answer ne X and answer ne Y
filter?