Lucene Search for documents that have a particular

2019-04-12 12:13发布

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?

1条回答
冷血范
2楼-- · 2019-04-12 12:27

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

查看更多
登录 后发表回答