I have a question similar to this: Solr - Search parent having multiple child documents
Lets use that same example:
{
"id": "1",
"bookName_s": "Core Concepts",
"bookDescription_s": "This is the description",
"isbn_s": "ABCD:123",
"type_s":"book"
"reviews": [
{
"id": "2",
"Name_s": "review1",
"detail_s": "sample review",
"type":"review"
}
],
"students": [
{
"id": "3",
"Name_s": "student1",
"type":"student",
"student_s": "test student"
}
]
}
Given this structure, the question was how to retrieve all parents (books) that have a review of 'review1' and a student with name 'student1'.
The solution given is:
{!parent which="type:book"}(type:review AND Name_s:review1) OR (type:student AND Name_s:student1)
This however, would also return other books that have a review of 'review1', but not having the 'student1' as student (and vice versa). I would like to retrieve all books that have both the review and the student matching. Only if both match I want the book to be returned. At first you might think replacing OR for AND would do the trick:
{!parent which="type:book"}(type:review AND Name_s:review1) AND (type:student AND Name_s:student1)
But this doesn't return any results. Simply because it now looks for documents with type 'review' AND type 'student' AND Name_s 'review1' AND Name_s 'student1'. These are single-value fields that won't hold both values ever. How can we accomplish what I'm looking for?