I'm using the latest (beta) version of Lucene.NET 4.8.
I have a pretty tricky access system, and I need my search engine to respect it. Hence, I need to filter my search queries by documents having or not a field. The field in question is a "tag" field (aka a document can have multiple such fields), and we consider a document "private" if it have no "tag" fields assigned. So I don't know in advance what content that field will have.
The only way I found so far is to use:
var filterQuery = new WildcardQuery(new Term("tag", "?*"));
Although using a wildcard query matching at least one symbol seems to me kind of overkill - even if it actually seems to be working just fine.
Is there a better solution without reindexing and introducing a new field?