带有分组的Solr查询不起作用 [英] Solr query with grouping not working
本文介绍了带有分组的Solr查询不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下查询工作正常:
q=field_one:value_one AND -field_two:[* TO *] AND -field_three:[* TO *]
但是,只要在其中放入括号,我就没有结果
However, as soon as I put brackets in there I get no results
q=field_one:value_one AND (-field_two:[* TO *] AND -field_three:[* TO *])
这两个查询不相等吗?
谢谢
戴夫
注意:我正在这样做,因为我需要将更多的与"与或"相结合;不仅仅是因为我喜欢括号.
NB: I'm doing this as I need to combine more 'AND's with 'OR's; rather than just because I like brackets.
推荐答案
将布尔值换成一点,我有一些有用的东西.
Swapping the boolean around a bit I have something that works.
q=field_one:value_one AND -(field_two:[* TO *] OR field_three:[* TO *])
提供与原始查询相同的结果,但不带括号.
gives the same results as the original query with no brackets.
不知道为什么Solr对其他语法如此挑剔.对我来说似乎有些奇怪.
No idea why Solr is so picky about the other syntax though. Seems a little bizarre to me.
这篇关于带有分组的Solr查询不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文