May be you can try using AND condition in the single join something like 

q={!join from=parent to=id}(Id:xxx AND (Color:red OR Color:Blue)), I don't 
think this will give bigger performance issue.

Thanks

Ravi

-----Original Message-----
From: Darin Amos [mailto:dari...@gmail.com] 
Sent: Thursday, December 11, 2014 1:23 PM
To: solr-user@lucene.apache.org
Subject: Re: Help with a Join Query

Thanks,

That looks like a viable option, I could do something like the following:

q={!join from=parent to=id}<my main search term query> &fq={!join from=parent 
to=id}color:red &fq={!join from=parent to=id}color:blue

With all these joins happening like this, what kind of performance concern is 
this? I would guess this would start to cause a lot of work.

Thanks

Darin



> On Dec 11, 2014, at 1:04 PM, Kydryavtsev Andrey <werde...@yandex.ru> wrote:
> 
> How about something like
> 
> ({!join from=parent to=id}color:red) AND ({!join from=parent 
> to=id}color:blue) ?
> 
> 11.12.2014, 19:48, "Darin Amos" <dari...@gmail.com>:
>> Hello,
>> 
>> I am trying to execute a join query that I am not 100% sure how to execute. 
>> Lets say I have a bunch of parent and child documents and every one of my 
>> child documents has a single value field “color”.
>> 
>> If I want to search all parents that have a “red” child, tis is very easy:
>> 
>> {!join from=parent to=id}color:red
>> 
>> However, if I want to return only parents that have both a red AND a blue 
>> item it gets tricky.
>> 
>> This query would return parents that have red OR blue {!join 
>> from=parent to=id}color:red OR color:blue
>> 
>> And this query would return nothing since no child had both colors.
>> {!join from=parent to=id}color:red AND color:blue
>> 
>> Any suggestions? My thinking is I might require some kind of custom query.
>> 
>> Thanks!
>> 
>> Darin

Reply via email to