1

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 ?

3
  • hi could you please provide the full query here. Commented Nov 25, 2016 at 21:48
  • The same query i'd posted in the question , Pasting again for your reference : ({!parent which="doc_type:parent"}"abc def") OR ({!parent which="doc_type:parent"}"hij lmn") Commented Nov 28, 2016 at 10:51
  • 1
    Hello , Any updates on the answer ? Am quite stuck on this . Commented Nov 30, 2016 at 17:51

2 Answers 2

2

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")

Sign up to request clarification or add additional context in comments.

1 Comment

This solution would solve the syntax issue . But the query result being returned is wrong
1

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" '})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.