开发者

Solr OR query for different combination of facets

开发者 https://www.devze.com 2022-12-29 16:02 出处:网络
I have a sample Solr schema as follows isPublic = boolean source = facebook| twitter | wordpress I want to write a query which returns all documents from the index which matches either the isPublic

I have a sample Solr schema as follows

  isPublic = boolean
  source = facebook| twitter | wordpress

I want to write a query which returns all documents from the index which matches either the isPublic = true or isPublic is false and source= facebook. S开发者_StackOverflowomething like this

 solrUrl/?q=blah&fq=(isPublic:true OR (isPublic:false AND source:facebook))

Is such a thing possible or should I search the index two times with each of these conditions and then combine + de-duplicate the results?


Sure you can run such a filter query, but I think that particular query will not get you the results you're looking for, see this question about it. A logically equivalent query would be: isPublic:true OR source:facebook

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号