How I find empty Solr document fields with lucene query

荒凉一梦 提交于 2019-12-22 08:15:51

问题


i have some documents like this:

<doc>
  <str name="navTitle"/>
  <str name="title">Word 1</str>
</doc>
<doc>
  <str name="navTitle">Word 2</str>
  <str name="title">Word 3</str>
</doc>

and i will find all documents with an emtpy "navTitle" field! How is the lucene query for this?

I trying " navTitle:'' " and I trying " navTitle:' ' ", but the Solr Admin Panal find nothing. Whats wrong at the query?


回答1:


In the SolrQuerySytax page they says that you can use the following query to find all empty queries.

-field:[* TO *] finds all documents without a value for field


来源:https://stackoverflow.com/questions/11391628/how-i-find-empty-solr-document-fields-with-lucene-query

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