1

I am using Lucene.Net for my indexing.

For certain fields I have a true/false value, that is passed to a analyzer ANALYZED.

My questions is simple, is it better to skip the value false and pass a empty value to the indexer and perform a search for 'false' using BooleanQuery and search using Occur.MUST_NOT = true , or is it better to index it and search for Occur.MUST = false.

Mad Dog Tannen
  • 7,129
  • 5
  • 31
  • 55

1 Answers1

0

Definitely keep the "false" values in the index.

Queries like: -myBool:true are problematic in Lucene, and may force you into workarounds with a MatchAllDocsQuery, which is both awkward and a performance killer.

Any savings you would get on space from eliminating them would likely be trivial, especially if the field in question is index-only (not stored).

Community
  • 1
  • 1
femtoRgon
  • 32,893
  • 7
  • 60
  • 87