You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Gastone Penzo <ga...@gmail.com> on 2011/03/21 12:46:22 UTC

Logic operator with dismax

Hi.
i have a problem with logic operator OR in dismax query search.
some days ago the query worked well. now it returns me anything (0
documents)

i explain:

the query is:
http://localhost:8983/solr/select/?q=
"1324"OR"4322"OR"2324"OR%20hello+world&defType=dismax&qf=code%20title

the schema has the fields:
code
title

i want to search the docs with hello world in the title, plus the docs with
the codes 1324,4322,2324 (even if they don't have hello world in the title).
the result is the query returns to me the docs with these codes AND hello
world in the title (logic AND, not OR)

the default operator in the schema is OR

what's happened??

thank you



-- 
Gastone Penzo

*www.solr-italia.it*
The first italian blog dedicated to Apache Solr

Re: Logic operator with dismax

Posted by Jayendra Patil <ja...@gmail.com>.
Dismax does not support boolean queries, you may try using Extended
Dismax for the boolean support.
https://issues.apache.org/jira/browse/SOLR-1553

Regards,
Jayendra

On Mon, Mar 21, 2011 at 8:24 AM, Savvas-Andreas Moysidis
<sa...@googlemail.com> wrote:
> Hello,
>
> The Dismax search handler doesn't have the concept of a logical operator in
> terms of OR-AND but rather uses a feature called Min-Should-Match (or mm).
> This parameter specifies the absolute number or percentage of the entered
> terms that you need them to match. To have an OR-like effect you can specify
> an mm=0% and for AND-like an mm=100% should work.
>
> More information can be found here:
> http://wiki.apache.org/solr/DisMaxQParserPlugin#mm_.28Minimum_.27Should.27_Match.29
>
> On 21 March 2011 11:46, Gastone Penzo <ga...@gmail.com> wrote:
>
>> Hi.
>> i have a problem with logic operator OR in dismax query search.
>> some days ago the query worked well. now it returns me anything (0
>> documents)
>>
>> i explain:
>>
>> the query is:
>> http://localhost:8983/solr/select/?q=
>> "1324"OR"4322"OR"2324"OR%20hello+world&defType=dismax&qf=code%20title
>>
>> the schema has the fields:
>> code
>> title
>>
>> i want to search the docs with hello world in the title, plus the docs with
>> the codes 1324,4322,2324 (even if they don't have hello world in the
>> title).
>> the result is the query returns to me the docs with these codes AND hello
>> world in the title (logic AND, not OR)
>>
>> the default operator in the schema is OR
>>
>> what's happened??
>>
>> thank you
>>
>>
>>
>> --
>> Gastone Penzo
>>
>> *www.solr-italia.it*
>> The first italian blog dedicated to Apache Solr
>>
>

Re: Logic operator with dismax

Posted by Savvas-Andreas Moysidis <sa...@googlemail.com>.
Hello,

The Dismax search handler doesn't have the concept of a logical operator in
terms of OR-AND but rather uses a feature called Min-Should-Match (or mm).
This parameter specifies the absolute number or percentage of the entered
terms that you need them to match. To have an OR-like effect you can specify
an mm=0% and for AND-like an mm=100% should work.

More information can be found here:
http://wiki.apache.org/solr/DisMaxQParserPlugin#mm_.28Minimum_.27Should.27_Match.29

On 21 March 2011 11:46, Gastone Penzo <ga...@gmail.com> wrote:

> Hi.
> i have a problem with logic operator OR in dismax query search.
> some days ago the query worked well. now it returns me anything (0
> documents)
>
> i explain:
>
> the query is:
> http://localhost:8983/solr/select/?q=
> "1324"OR"4322"OR"2324"OR%20hello+world&defType=dismax&qf=code%20title
>
> the schema has the fields:
> code
> title
>
> i want to search the docs with hello world in the title, plus the docs with
> the codes 1324,4322,2324 (even if they don't have hello world in the
> title).
> the result is the query returns to me the docs with these codes AND hello
> world in the title (logic AND, not OR)
>
> the default operator in the schema is OR
>
> what's happened??
>
> thank you
>
>
>
> --
> Gastone Penzo
>
> *www.solr-italia.it*
> The first italian blog dedicated to Apache Solr
>