如何查询 lucene 的空字段? [英] How to query lucene for empty fields?
本文介绍了如何查询 lucene 的空字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望在我的查询的第二部分有一个结果列表,而数据不为空.我发现如何在 solr 中做到这一点,但在 lucene 中却没有.任何人都有一个想法谢谢
I want in 2nd part of my query to have a list of result for while data not null. I find how do it in solr but not in lucene. Anyone have a idea Thanks
字符串:
(field_one:search AND field_two:3000) OR (field_three:search AND field_two:3000 AND NOT NULL field_one)
( field_one:search AND field_two:3000) OR (field_three:search AND field_two:3000 AND NOT NULL field_one )
查询:
+field_one:搜索 +field_two:3000+field_three:search +field_two:3000 -field_one:null
+field_one:search +field_two:3000 +field_three:search +field_two:3000 -field_one:null
推荐答案
*:* -MY_FIELD_NAME:[* TO *]
上面应该做,注意 * : * for Lucene.
The above should do it, note the * : * for Lucene.
这篇关于如何查询 lucene 的空字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文