On Wed, Apr 10, 2013 at 7:33 AM, Upayavira <[email protected]> wrote:
> On Wed, Apr 10, 2013, at 12:22 PM, Upayavira wrote:
>> I'm sure the best way for me to solve this issue myself is to ask it
>> publicly, so...
>>
>> If I have two {!join} queries that select a collection of documents
>> each, how do I create a filter query that combines their results?
>>
>> If I do fq={!join....} {!join...} it only considers the first.
>>
>> From what I understand, the Lucene query parser should combine these two
>> with an implicit OR, no?
>
> Yup. My theory worked, I did solve it myself.
>
> If I instead do fq=_query_:"{!join...}" _query_:"{!join...}" it works
> fine, but the shortened syntax above, which I believe is supposed to
> work, doesn't. This is using Solr 4.0.
Support was first added in 4.1 for this.
If a query starts with {!join... then that will use the join query
parser (which will consider *everything* after part of the "from"
query.). If you want "lucene" syntax with two embedded join queries,
then just make sure that the query string does not start with {!
for example:
fq= {!join from=f1 to=f2 v='f3:term1'} {!join from=f3 to=f4 v='f4:term2'}
(notice the space before the {! that prevents invoking a different
query parser and thus invokes the default lucene syntax)
-Yonik
http://lucidworks.com