0
votes

I want to get all documents from azure search and filter out with NOT operator. For example, I want to get all documents without term wifi.

NOT operator can't be used on its own, from lucene documentation:

The NOT operator cannot be used with just one term. For example, the following search will return no results: NOT "jakarta apache"

For that we have to match all documents and then filter out some:

*:* NOT wifi

Question: How can I match all documents in azure search like *:* in lucene? Thanks in advance!

1
Can you explain (ideally by pointing to Lucene documentation) what the *:* expression is? I looks like an invalid wildcard query since wildcard queries can't begin with the * or ? symbol.Yahnoosh

1 Answers

1
votes

One way is to issue a regex search that matches all documents and filter out ones you don't want with the NOT operator. Note that regex search is only supported in the full Lucene query syntax (queryType=full).

For example.

search=/.*/ NOT "Jakarta apache"&queryType=full.

Please note that the "match all" regex pattern can potentially expensive, because it expands to all the terms in the searchable fields in the index. Please make sure it meets your expectation performance-wise.

Nate