You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Valentin <vs...@free.fr> on 2011/08/17 14:46:39 UTC

SolR : eDismax does not always use the defaultOperator "AND"

I set the defaultOperator at "AND" in shema.xml : <solrQueryParser
defaultOperator="AND"/>

I use the defType=eDismax in my query. It works very well, but when I want
to use "AND" or "OR" operators, it doesn't use "AND" as the default operator
for the blanks I left without operators.

Examples:

field1:a field2:b does the same thing than field1:a AND field2:b : OK

field1:a OR field2:b : OK, I have all the results that I want

but

field1:a (field2:b OR field2:c) does the same thing than field1:a OR
(field2:b OR field2:c) : that's not OK

How can I force him to use "AND" as the default operator even in that case ?

--
View this message in context: http://lucene.472066.n3.nabble.com/SolR-eDismax-does-not-always-use-the-defaultOperator-AND-tp3261500p3261500.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: SolR : eDismax does not always use the defaultOperator "AND"

Posted by "Dyer, James" <Ja...@ingrambook.com>.
Valentin,

There is currently an open issue about this:  https://issues.apache.org/jira/browse/SOLR-2649 .  I ran into this also and ended up telling all of the application developers to always insert "AND" between every user keywords.  I was using an older version of edismax but the person who opened the issue reported this for 3.3.

James Dyer
E-Commerce Systems
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Valentin [mailto:igorlacroute@gmail.com] 
Sent: Wednesday, August 17, 2011 9:05 AM
To: solr-user@lucene.apache.org
Subject: Re: SolR : eDismax does not always use the defaultOperator "AND"

I had put mm at 4<75%, so if i understand it well, for 4 words or less, it
has to match all the words.

In my tests, i did it with 3 words, so i don't understand the results...


thanks for your answer,

Valentin

--
View this message in context: http://lucene.472066.n3.nabble.com/SolR-eDismax-does-not-always-use-the-defaultOperator-AND-tp3261500p3261703.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SolR : eDismax does not always use the defaultOperator "AND"

Posted by Valentin <ig...@gmail.com>.
I had put mm at 4<75%, so if i understand it well, for 4 words or less, it
has to match all the words.

In my tests, i did it with 3 words, so i don't understand the results...


thanks for your answer,

Valentin

--
View this message in context: http://lucene.472066.n3.nabble.com/SolR-eDismax-does-not-always-use-the-defaultOperator-AND-tp3261500p3261703.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SolR : eDismax does not always use the defaultOperator "AND"

Posted by Shawn Heisey <so...@elyograg.org>.
On 8/17/2011 6:46 AM, Valentin wrote:
> I set the defaultOperator at "AND" in shema.xml :<solrQueryParser
> defaultOperator="AND"/>
>
> I use the defType=eDismax in my query. It works very well, but when I want
> to use "AND" or "OR" operators, it doesn't use "AND" as the default operator
> for the blanks I left without operators.
>
> Examples:
>
> field1:a field2:b does the same thing than field1:a AND field2:b : OK
>
> field1:a OR field2:b : OK, I have all the results that I want
>
> but
>
> field1:a (field2:b OR field2:c) does the same thing than field1:a OR
> (field2:b OR field2:c) : that's not OK
>
> How can I force him to use "AND" as the default operator even in that case ?

The dismax and edismax parsers do not respect the default operator in 
quite the way you might expect.  They give you much more control than 
simply choosing one or the other.  The value of the mm parameter gives 
you very fine-grained control over how much of your query must match the 
document.  This is particularly useful if the user enters a lot of terms 
- you might want only 75% of them to be absolutely required.

http://wiki.apache.org/solr/DisMaxQParserPlugin#mm_.28Minimum_.27Should.27_Match.29

If you simply want to duplicate "AND", set mm=100% either in your query 
URL or in your solrconfig.xml request handler definition.  According to 
the wiki, if you are using 3.1 or later, you could leave mm out entirely 
and it will respect the default operator you've defined in your config, 
but if you specify a value for mm, it will be used instead.

Shawn