RP4
RP4

Reputation: 41

Lucene Search for documents that have a particular field?

Lucene.Net - Is there a way to query for documents that contain a particular field.

Lets say some of my documents have a field 'foo' and some do not.

I want to find all documents that have the field 'foo' - regardless of what the value of foo is.

How do I do this? Is it some sort of TermQuery?

Upvotes: 3

Views: 427

Answers (1)

Mikos
Mikos

Reputation: 8563

Try foo:[* TO *] should work for all non-null values of field 'foo'

Upvotes: 1

Related Questions