Let's say I have 2 instances of a class called "Animal".
The animal has 3 fields: name, age and type
The name field is NULL, so before I insert an instance of Animal as a document with the Lucene index, I check if Animal.Name == null, and if so, I do not insert it as a field in my document. If I were to return all the animals, I would see that the Name field does not exist, and I can set its value to null.
However, there may be situations where I want to say, "Bring me all the animals that do not yet have the name indicated." In this situation, I want to get all Lucene.NET documents from my index of animals that do not contain the Name field.
Is there an easy way to do this with Lucene.NET? I want to stay away from having to do some kind of hack to check if my name field has a value of "null".
source
share