Using NEST (1.7.1) I have a specific search, where one field should match some collection of values OR this field should be null. Seems trival but I cannot create this query so the result would be the same as result when I'm not filtering my documents by this field.
Document:
public class Document
{
...
[ElasticProperty(Index = FieldIndexOption.NotAnalyzed)]
public string Field{ get; set; }
}
Query to match any of values from given collection:
Filter<Document>.Query(q => q.Terms(p=> p.Field, matchingCollection));
To match also those documents, which have NULL set as Field I was trying to add:
matchingCollection.Add(string.Empty);
matchingCollection.Add("NULL");
But without any success. Any ideas ? Thank you :)
"NULL", or should the field be null i.e. missing? - Russ Cam