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 Thierry Collogne <th...@gmail.com> on 2007/07/02 13:01:47 UTC
How to use AND / OR with DismaxRequestHandler?
Hello,
I have a couple questions about the DismaxRequestHandler. I am using it,
because I want to use the boosting mechanism, but I can't get the following
to work :
We also have an advanced search where users can search for :
* An exact combination of words
* All the words
* One of the words
* Part of a word
This is a bit like the advanced search from google.
Can this be done when using the DismaxRequestHandler? I did a test with 2
queries :
* post OR lettre
* post AND lettre
When using the DismaxRequestHandler I get the same search results, with the
StandardRequestHandler, the OR query gives me much more results than the
AND.
Can someone explain to me how to use OR and AND with the
DismaxRequestHandler?
Thank you.
Re: How to use AND / OR with DismaxRequestHandler?
Posted by Chris Hostetter <ho...@fucit.org>.
dismax is designed for usecases like...
* users enter a handfull of words (albino elephant gift)
* users enter some words, with prefixes indicating some
are required and some are prohibited (albino +elephand -gift)
* users enter words or phrases ("albino elephant" gift)
as far as AND/OR/NOT type logic, if it's the user telling you what they
want (ie: this term must be there, this term can't be there) that's where
the +/- syntax comes in; if it's a question of "how much flexibility
should i allow for matching on the terms that aren't
mandatory/prohibited?" that's where the "mm" option comes in.
: > http://wiki.apache.org/solr/DisMaxRequestHandler
i *just* updated that wiki page on friday with some specifics on the
params and usage ... but by all means anyone else out there using
dismax, *PLEASE* update it as you see fit to help explain how it works and
how to use it.
-Hoss
Re: How to use AND / OR with DismaxRequestHandler?
Posted by Thierry Collogne <th...@gmail.com>.
The 1 and 100% did it. But I am not sure how I can do the exact combination
(phrase).
Could you tell me, please?
On 02/07/07, Paul Borgermans <pa...@gmail.com> wrote:
>
> Hi
>
> Take a look at the query parameters it supports:
>
> http://wiki.apache.org/solr/DisMaxRequestHandler
>
> An exact combination (phrase), all of the words or one are possible:
> you can use the mm parameter (100% and 1 for your case).
>
> Part of a word is not possible, nor explicit query fields in the q
> parameter.
>
> hth
> Paul
>
> On 7/2/07, Thierry Collogne <th...@gmail.com> wrote:
> > Hello,
> >
> > I have a couple questions about the DismaxRequestHandler. I am using it,
> > because I want to use the boosting mechanism, but I can't get the
> following
> > to work :
> >
> > We also have an advanced search where users can search for :
> >
> > * An exact combination of words
> > * All the words
> > * One of the words
> > * Part of a word
> >
> > This is a bit like the advanced search from google.
> >
> > Can this be done when using the DismaxRequestHandler? I did a test with
> 2
> > queries :
> > * post OR lettre
> > * post AND lettre
> >
> > When using the DismaxRequestHandler I get the same search results, with
> the
> > StandardRequestHandler, the OR query gives me much more results than the
> > AND.
> >
> > Can someone explain to me how to use OR and AND with the
> > DismaxRequestHandler?
> >
> > Thank you.
> >
>
Re: How to use AND / OR with DismaxRequestHandler?
Posted by Paul Borgermans <pa...@gmail.com>.
Hi
Take a look at the query parameters it supports:
http://wiki.apache.org/solr/DisMaxRequestHandler
An exact combination (phrase), all of the words or one are possible:
you can use the mm parameter (100% and 1 for your case).
Part of a word is not possible, nor explicit query fields in the q parameter.
hth
Paul
On 7/2/07, Thierry Collogne <th...@gmail.com> wrote:
> Hello,
>
> I have a couple questions about the DismaxRequestHandler. I am using it,
> because I want to use the boosting mechanism, but I can't get the following
> to work :
>
> We also have an advanced search where users can search for :
>
> * An exact combination of words
> * All the words
> * One of the words
> * Part of a word
>
> This is a bit like the advanced search from google.
>
> Can this be done when using the DismaxRequestHandler? I did a test with 2
> queries :
> * post OR lettre
> * post AND lettre
>
> When using the DismaxRequestHandler I get the same search results, with the
> StandardRequestHandler, the OR query gives me much more results than the
> AND.
>
> Can someone explain to me how to use OR and AND with the
> DismaxRequestHandler?
>
> Thank you.
>
Re: How to use AND / OR with DismaxRequestHandler?
Posted by Nick Jenkin <nj...@gmail.com>.
Not sure you can, but if it helps you can use boosting in the standard
request handler:
post AND lettre _val_:"recip(popularityRank,1,1000,1000)^2.5"
-Nick
On 7/2/07, Thierry Collogne <th...@gmail.com> wrote:
> Hello,
>
> I have a couple questions about the DismaxRequestHandler. I am using it,
> because I want to use the boosting mechanism, but I can't get the following
> to work :
>
> We also have an advanced search where users can search for :
>
> * An exact combination of words
> * All the words
> * One of the words
> * Part of a word
>
> This is a bit like the advanced search from google.
>
> Can this be done when using the DismaxRequestHandler? I did a test with 2
> queries :
> * post OR lettre
> * post AND lettre
>
> When using the DismaxRequestHandler I get the same search results, with the
> StandardRequestHandler, the OR query gives me much more results than the
> AND.
>
> Can someone explain to me how to use OR and AND with the
> DismaxRequestHandler?
>
> Thank you.
>