我如何使用Lucene查询找到空的Solr文档字段 [英] How I find empty Solr document fields with lucene query

查看:65
本文介绍了我如何使用Lucene查询找到空的Solr文档字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些像这样的文件:

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>

,我将找到所有带有空"navTitle"字段的文档! lucene如何查询呢?

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

我尝试使用"navTitle:"和"navTitle:''",但是Solr Admin Panal找不到任何内容. 查询出了什么问题?

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

推荐答案

SolrQuerySytax 页中他们说您可以使用以下查询来查找所有空查询.

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

这篇关于我如何使用Lucene查询找到空的Solr文档字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆