Solr OR query for different combination of facets

Posted by Ritesh M Nayak on Stack Overflow See other posts from Stack Overflow or by Ritesh M Nayak
Published on 2010-05-04T08:06:44Z Indexed on 2010/05/15 17:24 UTC
Read the original article Hit count: 173

Filed under:
|
|
|

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. Something 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?

© Stack Overflow or respective owner

Related posts about solr

Related posts about query