Lucene Search for documents that have a particular field?

感情迁移 提交于 2019-12-21 20:14:45

问题


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:


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



来源:https://stackoverflow.com/questions/2686033/lucene-search-for-documents-that-have-a-particular-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!