lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dotan Cohen <>
Subject Re: Phrase matching with set union as opposed to set intersection on query terms
Date Wed, 05 Jun 2013 16:06:34 GMT
On Wed, Jun 5, 2013 at 6:10 PM, Shawn Heisey <> wrote:
> On 6/5/2013 9:03 AM, Dotan Cohen wrote:
>> How would one write a query which should perform set union on the
>> search terms (term1 OR term2 OR term3), and yet also perform phrase
>> matching if both terms are found? I tried a few variants of the
>> following, but in every case I am getting set intersection on the
>> search terms:
>> select?q={!q.op=OR}text:"term1 term2"~100000
> A phrase search by definition will require all terms to be present.
> Even though it is multiple terms, conceptually it is treated as a single
> term.
> It sounds like what you are after is what edismax can do.  If you define
> the pf field in addition to the qf field, Solr will do something pretty
> amazing - it will automatically construct a phrase query from a
> non-phrase query and search with it against multiple fields.  Done
> correctly, this means that an exact match will be listed first in the
> results.
> Thanks,
> Shawn

Thank you Shawn, this pretty much does what I need it to do:
select?defType=edismax&q={!q.op=OR}search_field:term1 term2&pf=search_field

I'm reviewing the Edismax page now. Is there any other documentation
that I should review? I have found the Edismax page at the wonderful
lucidworks site, but if there are any other documentation that I
should review to squeeze the most out of Edismax thenI would love to
know about it.

Thank you very much!

Dotan Cohen

View raw message