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 hbi dev <hb...@googlemail.com> on 2009/03/12 15:06:09 UTC

Operators and Minimum Match with Dismax handler

Hi All,

I have a question regarding the dismax handler and minimum match (mm=)

I have an index which we are setting the default operator to AND.
Am I right in saying that using the dismax handler, the default operator in
the schema file is effectively ignored? (This is the conclusion I've made
from testing myself)

So I have set the mm value to 100%

The issue I have with this, is that if I want to include an OR in my phrase,
these are effectively getting ignored. The parser is still trying to match
100% of the search terms

e.g. 'lucene OR query' still only finds matches for 'lucene AND query'
the parsed query is: +(((drug_name:lucen) (drug_name:queri))~2) ()

I know I could programatically set the mm=0 if my phrase contains certain
keywords, however this would get very complicated with more terms in the
phrase (I'd have to preserve/inject operators to keep my "default") and I
assume I would effectively be duplicating what dismax handler does for the
most part already.

Does anyone have any advise as to how I could deal with this kkind of
problem?

Thanks
Waseem

RE: Operators and Minimum Match with Dismax handler

Posted by "Dean Missikowski (Consultant), CLSA" <de...@clsa.com>.
I'm using dismax with the default operator set to AND, and don't use
Minimum Match (commented out in solrconfig.xml), meaning 100% of the
terms must match.  Then in my application logic I use a regex that
checks if the query contains " OR ", and if it does I add &mm=1 to the
solr request to effectively turn the query into an OR. This trick
doesn't work for complex boolean queries but works for simple xxx OR
yyy. 

-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: 18/03/2009 10:45 AM
To: solr-user@lucene.apache.org
Subject: Re: Operators and Minimum Match with Dismax handler

: I have an index which we are setting the default operator to AND.
: Am I right in saying that using the dismax handler, the default
operator in
: the schema file is effectively ignored? (This is the conclusion I've
made
: from testing myself)

correct.

: The issue I have with this, is that if I want to include an OR in my
phrase,
: these are effectively getting ignored. The parser is still trying to
match
: 100% of the search terms
: 
: e.g. 'lucene OR query' still only finds matches for 'lucene AND query'
: the parsed query is: +(((drug_name:lucen) (drug_name:queri))~2) ()

correct.  dismax isn't designed to be used that way (it's a fluke of 
the implementation that using " AND " works at all)

: Does anyone have any advise as to how I could deal with this kkind of
: problem?

i would set your mm to something smaller and let your users use "+" when

they want to make something required.  if you really want to support the

AND/OR/NOT type sequence  ... don't use dismax: that type of syntax is 
what the standard parser is for.


-Hoss


CLSA CLEAN & GREEN: Please consider our environment before printing this email.
The content of this communication is subject to CLSA Legal and Regulatory Notices. 
These can be viewed at https://www.clsa.com/disclaimer.html or sent to you upon request.



Re: Operators and Minimum Match with Dismax handler

Posted by Chris Hostetter <ho...@fucit.org>.
: I have an index which we are setting the default operator to AND.
: Am I right in saying that using the dismax handler, the default operator in
: the schema file is effectively ignored? (This is the conclusion I've made
: from testing myself)

correct.

: The issue I have with this, is that if I want to include an OR in my phrase,
: these are effectively getting ignored. The parser is still trying to match
: 100% of the search terms
: 
: e.g. 'lucene OR query' still only finds matches for 'lucene AND query'
: the parsed query is: +(((drug_name:lucen) (drug_name:queri))~2) ()

correct.  dismax isn't designed to be used that way (it's a fluke of 
the implementation that using " AND " works at all)

: Does anyone have any advise as to how I could deal with this kkind of
: problem?

i would set your mm to something smaller and let your users use "+" when 
they want to make something required.  if you really want to support the 
AND/OR/NOT type sequence  ... don't use dismax: that type of syntax is 
what the standard parser is for.


-Hoss