Reputation: 511
How to do an OR between two block join clauses .
for example : I want to find all parent documents who has the phrases "abc def" OR "hij lmn"
Assumption here being "abc def " and "hij lmn" are in different child docs and all parent docs have an identifier doc_type:parent
Logically , the query would be:
({!parent which="doc_type:parent"}"abc def") OR ({!parent which="doc_type:parent"}"hij lmn")
.
This query would throw the
EOF .org.apache.solr.search.SyntaxError: Cannot parse '\"abc': Lexical error at line 1, column 5.
Encountered: after : \"\\"abc\""error .
I cannot combine with fq's because i have an OR operator here . How do we solve this ?
Upvotes: 1
Views: 545
Reputation: 511
This issue has been answered by Yonik Seeley at the following link http://comments.gmane.org/gmane.comp.jakarta.lucene.solr.user/95646
Quoting the answer for ease : ({!parent which="doc_type:parent" v=' "abc def" '}) OR ({!parent which="doc_type:parent" v=' "hij lmn" '})
Upvotes: 1
Reputation: 21
try with single space after the block join construct e.g ({!parent which="doc_type:parent"} "abc def") OR ({!parent which="doc_type:parent"} "hij lmn")
Upvotes: 2