SOLR query with multiple fields using Not Equals operator with OR returns wrong result

混江龙づ霸主 提交于 2019-12-11 13:43:02

问题


I am trying to perform a solr query with multiple query fields including a not equals operator.

Example query:

field1:abc OR -field2:def

The problem is the query returns results for an AND operation instead of an OR, as if the query was:

field1:abc AND -field2.def

Both queries always return the same result. What is the correct syntax to achieve a correct OR result?

I am currently using solr 3.5.

Thanks


回答1:


Maybe try the following:

field1:abc OR (*:* -field2:def) 



回答2:


for field1:abc OR -field2:def this also works

-(-field1:abc AND field2:def) .



来源:https://stackoverflow.com/questions/14855122/solr-query-with-multiple-fields-using-not-equals-operator-with-or-returns-wrong

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