Yangrui
Yangrui

Reputation: 1247

Solr block join child field with expand gets error

I used solr's nested document support to index my documents. I tried to query both parent and children at the same time. My query is q={!parent which="parent_field"} child_field&wt=json&indent=true&expand=true&expand.field=root&expand.q=: However, some times on particular field I receive the following error:

child query must only match non-parent docs, but parent docID=2147483647 matched childScorer=class org.apache.lucene.search.TermScorer

This error seems to randomly happen. What caused this error? Is there an example of how to filter document by both parent and children using solr?

Upvotes: 3

Views: 2113

Answers (1)

Ramzy
Ramzy

Reputation: 7138

Block join is used to either a. retrieve parent based on child field match, or b. retrieve all child docs for a parent match but not both. Your query looks like you want to fetch parent documents with child field match. However, have you given "condition match for child_field"? I am not able to see it. documentation here

Upvotes: 3

Related Questions