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 Isan Fulia <is...@germinait.com> on 2011/01/27 09:52:13 UTC

DismaxParser Query

Hi all,
The query for standard request handler is as follows
field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
field5:(keyword5)


How the same above query can be written for dismax request handler

-- 
Thanks & Regards,
Isan Fulia.

Re: DismaxParser Query

Posted by Erick Erickson <er...@gmail.com>.
yes. I know it's been done by other users, but haven't done it myself...

Best
Erick

On Fri, Jan 28, 2011 at 12:37 AM, Isan Fulia <is...@germinait.com>wrote:

> Hi all,
> I am currently using solr1.4.1 .Do  I need to apply patch for extended
> dismax parser.
>
> On 28 January 2011 03:42, Erick Erickson <er...@gmail.com> wrote:
>
> > In general, patches are applied to the source tree and it's re-compiled.
> > See: http://wiki.apache.org/solr/HowToContribute#Working_With_Patches
> >
> > This is pretty easy, and I do know that "some people" have applied the
> > eDismax
> > patch to the 1.4 code line, but I haven't done it myself.
> >
> > Best
> > Erick
> >
> > On Thu, Jan 27, 2011 at 10:27 AM, Jonathan Rochkind <rochkind@jhu.edu
> > >wrote:
> >
> > > Yes, I think nested queries are the only way to do that, and yes,
> nested
> > > queries like Daniel's example work (I've done it myself).  I haven't
> > really
> > > tried to get into understanding/demonstrating _exactly_ how the
> relevance
> > > ends up working on the overall master query in such a situation, but it
> > sort
> > > of works.
> > >
> > > (Just note that Daniel's example isn't quite right, I think you need
> > double
> > > quotes for the nested _query_, just check the wiki page/blog post on
> > nested
> > > queries).
> > >
> > > Does eDismax handle parens for order of operation too?  If so, eDismax
> is
> > > probably the best/easiest solution, especially if you're trying to
> parse
> > an
> > > incoming query from some OTHER format and translate it to something
> that
> > can
> > > be sent to Solr, which is what I often do.
> > >
> > > I haven't messed with eDismax myself yet.  Does anyone know if there's
> > any
> > > easy (easy!) way to get eDismax in a Solr 1.4?  Any easy way to compile
> > an
> > > eDismax query parser on it's own that works with Solr 1.4, and then
> just
> > > drop it into your local lib/ for use with an existing Solr 1.4?
> > >
> > > Jonathan
> > >
> > > ________________________________________
> > > From: Daniel Pötzinger [daniel.poetzinger@aoemedia.de]
> > > Sent: Thursday, January 27, 2011 9:26 AM
> > > To: solr-user@lucene.apache.org
> > > Subject: AW: DismaxParser Query
> > >
> > > It may also be an option to mix the query parsers?
> > > Something like this (not tested):
> > >
> > > q={!lucene}field1:test OR field2:test2 _query_:{!dismax qf=fields}+my
> > > dismax -bad
> > >
> > > So you have the benefits of lucene and dismax parser
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Erick Erickson [mailto:erickerickson@gmail.com]
> > > Gesendet: Donnerstag, 27. Januar 2011 15:15
> > > An: solr-user@lucene.apache.org
> > > Betreff: Re: DismaxParser Query
> > >
> > > What version of Solr are you using, and could you consider either 3x or
> > > applying a patch to 1.4.1? Because eDismax (extended dismax) handles
> the
> > > full Lucene query language and probably works here. See the Solr
> > > JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553
> > >
> > > Best
> > > Erick
> > >
> > > On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <isan.fulia@germinait.com
> > > >wrote:
> > >
> > > > It worked by making mm=0 (it acted as OR operator)
> > > > but how to handle this
> > > >
> > > > field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > > > field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > > > field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
> > > >
> > > >
> > > >
> > > >
> > > > On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> > > > wrote:
> > > >
> > > > > sorry ignore that - we are on dismax here - look at mm param in the
> > > docs
> > > > > you can set this to achieve what you need
> > > > >
> > > > > On 27 January 2011 11:34, lee carroll <
> lee.a.carroll@googlemail.com>
> > > > > wrote:
> > > > >
> > > > > > the default operation can be set in your config to be "or" or on
> > the
> > > > > query
> > > > > > something like q.op=OR
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com>
> > > wrote:
> > > > > >
> > > > > >> but q="keyword1 keyword2"  does AND operation  not OR
> > > > > >>
> > > > > >> On 27 January 2011 16:22, lee carroll <
> > lee.a.carroll@googlemail.com
> > > >
> > > > > >> wrote:
> > > > > >>
> > > > > >> > use dismax q for first three fields and a filter query for the
> > 4th
> > > > and
> > > > > >> 5th
> > > > > >> > fields
> > > > > >> > so
> > > > > >> > q="keyword1 keyword 2"
> > > > > >> > qf = field1,feild2,field3
> > > > > >> > pf = field1,feild2,field3
> > > > > >> > mm=something sensible for you
> > > > > >> > defType=dismax
> > > > > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > > > > >> >
> > > > > >> > take a look at the dismax docs for extra params
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > On 27 January 2011 08:52, Isan Fulia <
> isan.fulia@germinait.com>
> > > > > wrote:
> > > > > >> >
> > > > > >> > > Hi all,
> > > > > >> > > The query for standard request handler is as follows
> > > > > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR
> keyword2)
> > > OR
> > > > > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR
> > keyword4)
> > > > AND
> > > > > >> > > field5:(keyword5)
> > > > > >> > >
> > > > > >> > >
> > > > > >> > > How the same above query can be written for dismax request
> > > handler
> > > > > >> > >
> > > > > >> > > --
> > > > > >> > > Thanks & Regards,
> > > > > >> > > Isan Fulia.
> > > > > >> > >
> > > > > >> >
> > > > > >>
> > > > > >>
> > > > > >>
> > > > > >> --
> > > > > >> Thanks & Regards,
> > > > > >> Isan Fulia.
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks & Regards,
> > > > Isan Fulia.
> > > >
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by Isan Fulia <is...@germinait.com>.
Hi all,
I am currently using solr1.4.1 .Do  I need to apply patch for extended
dismax parser.

On 28 January 2011 03:42, Erick Erickson <er...@gmail.com> wrote:

> In general, patches are applied to the source tree and it's re-compiled.
> See: http://wiki.apache.org/solr/HowToContribute#Working_With_Patches
>
> This is pretty easy, and I do know that "some people" have applied the
> eDismax
> patch to the 1.4 code line, but I haven't done it myself.
>
> Best
> Erick
>
> On Thu, Jan 27, 2011 at 10:27 AM, Jonathan Rochkind <rochkind@jhu.edu
> >wrote:
>
> > Yes, I think nested queries are the only way to do that, and yes, nested
> > queries like Daniel's example work (I've done it myself).  I haven't
> really
> > tried to get into understanding/demonstrating _exactly_ how the relevance
> > ends up working on the overall master query in such a situation, but it
> sort
> > of works.
> >
> > (Just note that Daniel's example isn't quite right, I think you need
> double
> > quotes for the nested _query_, just check the wiki page/blog post on
> nested
> > queries).
> >
> > Does eDismax handle parens for order of operation too?  If so, eDismax is
> > probably the best/easiest solution, especially if you're trying to parse
> an
> > incoming query from some OTHER format and translate it to something that
> can
> > be sent to Solr, which is what I often do.
> >
> > I haven't messed with eDismax myself yet.  Does anyone know if there's
> any
> > easy (easy!) way to get eDismax in a Solr 1.4?  Any easy way to compile
> an
> > eDismax query parser on it's own that works with Solr 1.4, and then just
> > drop it into your local lib/ for use with an existing Solr 1.4?
> >
> > Jonathan
> >
> > ________________________________________
> > From: Daniel Pötzinger [daniel.poetzinger@aoemedia.de]
> > Sent: Thursday, January 27, 2011 9:26 AM
> > To: solr-user@lucene.apache.org
> > Subject: AW: DismaxParser Query
> >
> > It may also be an option to mix the query parsers?
> > Something like this (not tested):
> >
> > q={!lucene}field1:test OR field2:test2 _query_:{!dismax qf=fields}+my
> > dismax -bad
> >
> > So you have the benefits of lucene and dismax parser
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Erick Erickson [mailto:erickerickson@gmail.com]
> > Gesendet: Donnerstag, 27. Januar 2011 15:15
> > An: solr-user@lucene.apache.org
> > Betreff: Re: DismaxParser Query
> >
> > What version of Solr are you using, and could you consider either 3x or
> > applying a patch to 1.4.1? Because eDismax (extended dismax) handles the
> > full Lucene query language and probably works here. See the Solr
> > JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553
> >
> > Best
> > Erick
> >
> > On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <isan.fulia@germinait.com
> > >wrote:
> >
> > > It worked by making mm=0 (it acted as OR operator)
> > > but how to handle this
> > >
> > > field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > > field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > > field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
> > >
> > >
> > >
> > >
> > > On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> > > wrote:
> > >
> > > > sorry ignore that - we are on dismax here - look at mm param in the
> > docs
> > > > you can set this to achieve what you need
> > > >
> > > > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > > > wrote:
> > > >
> > > > > the default operation can be set in your config to be "or" or on
> the
> > > > query
> > > > > something like q.op=OR
> > > > >
> > > > >
> > > > >
> > > > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com>
> > wrote:
> > > > >
> > > > >> but q="keyword1 keyword2"  does AND operation  not OR
> > > > >>
> > > > >> On 27 January 2011 16:22, lee carroll <
> lee.a.carroll@googlemail.com
> > >
> > > > >> wrote:
> > > > >>
> > > > >> > use dismax q for first three fields and a filter query for the
> 4th
> > > and
> > > > >> 5th
> > > > >> > fields
> > > > >> > so
> > > > >> > q="keyword1 keyword 2"
> > > > >> > qf = field1,feild2,field3
> > > > >> > pf = field1,feild2,field3
> > > > >> > mm=something sensible for you
> > > > >> > defType=dismax
> > > > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > > > >> >
> > > > >> > take a look at the dismax docs for extra params
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > > > wrote:
> > > > >> >
> > > > >> > > Hi all,
> > > > >> > > The query for standard request handler is as follows
> > > > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2)
> > OR
> > > > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR
> keyword4)
> > > AND
> > > > >> > > field5:(keyword5)
> > > > >> > >
> > > > >> > >
> > > > >> > > How the same above query can be written for dismax request
> > handler
> > > > >> > >
> > > > >> > > --
> > > > >> > > Thanks & Regards,
> > > > >> > > Isan Fulia.
> > > > >> > >
> > > > >> >
> > > > >>
> > > > >>
> > > > >>
> > > > >> --
> > > > >> Thanks & Regards,
> > > > >> Isan Fulia.
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks & Regards,
> > > Isan Fulia.
> > >
> >
>



-- 
Thanks & Regards,
Isan Fulia.

Re: DismaxParser Query

Posted by Erick Erickson <er...@gmail.com>.
In general, patches are applied to the source tree and it's re-compiled.
See: http://wiki.apache.org/solr/HowToContribute#Working_With_Patches

This is pretty easy, and I do know that "some people" have applied the
eDismax
patch to the 1.4 code line, but I haven't done it myself.

Best
Erick

On Thu, Jan 27, 2011 at 10:27 AM, Jonathan Rochkind <ro...@jhu.edu>wrote:

> Yes, I think nested queries are the only way to do that, and yes, nested
> queries like Daniel's example work (I've done it myself).  I haven't really
> tried to get into understanding/demonstrating _exactly_ how the relevance
> ends up working on the overall master query in such a situation, but it sort
> of works.
>
> (Just note that Daniel's example isn't quite right, I think you need double
> quotes for the nested _query_, just check the wiki page/blog post on nested
> queries).
>
> Does eDismax handle parens for order of operation too?  If so, eDismax is
> probably the best/easiest solution, especially if you're trying to parse an
> incoming query from some OTHER format and translate it to something that can
> be sent to Solr, which is what I often do.
>
> I haven't messed with eDismax myself yet.  Does anyone know if there's any
> easy (easy!) way to get eDismax in a Solr 1.4?  Any easy way to compile an
> eDismax query parser on it's own that works with Solr 1.4, and then just
> drop it into your local lib/ for use with an existing Solr 1.4?
>
> Jonathan
>
> ________________________________________
> From: Daniel Pötzinger [daniel.poetzinger@aoemedia.de]
> Sent: Thursday, January 27, 2011 9:26 AM
> To: solr-user@lucene.apache.org
> Subject: AW: DismaxParser Query
>
> It may also be an option to mix the query parsers?
> Something like this (not tested):
>
> q={!lucene}field1:test OR field2:test2 _query_:{!dismax qf=fields}+my
> dismax -bad
>
> So you have the benefits of lucene and dismax parser
>
> -----Ursprüngliche Nachricht-----
> Von: Erick Erickson [mailto:erickerickson@gmail.com]
> Gesendet: Donnerstag, 27. Januar 2011 15:15
> An: solr-user@lucene.apache.org
> Betreff: Re: DismaxParser Query
>
> What version of Solr are you using, and could you consider either 3x or
> applying a patch to 1.4.1? Because eDismax (extended dismax) handles the
> full Lucene query language and probably works here. See the Solr
> JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553
>
> Best
> Erick
>
> On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <isan.fulia@germinait.com
> >wrote:
>
> > It worked by making mm=0 (it acted as OR operator)
> > but how to handle this
> >
> > field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> > field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
> >
> >
> >
> >
> > On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> > wrote:
> >
> > > sorry ignore that - we are on dismax here - look at mm param in the
> docs
> > > you can set this to achieve what you need
> > >
> > > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > > wrote:
> > >
> > > > the default operation can be set in your config to be "or" or on the
> > > query
> > > > something like q.op=OR
> > > >
> > > >
> > > >
> > > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com>
> wrote:
> > > >
> > > >> but q="keyword1 keyword2"  does AND operation  not OR
> > > >>
> > > >> On 27 January 2011 16:22, lee carroll <lee.a.carroll@googlemail.com
> >
> > > >> wrote:
> > > >>
> > > >> > use dismax q for first three fields and a filter query for the 4th
> > and
> > > >> 5th
> > > >> > fields
> > > >> > so
> > > >> > q="keyword1 keyword 2"
> > > >> > qf = field1,feild2,field3
> > > >> > pf = field1,feild2,field3
> > > >> > mm=something sensible for you
> > > >> > defType=dismax
> > > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > > >> >
> > > >> > take a look at the dismax docs for extra params
> > > >> >
> > > >> >
> > > >> >
> > > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > > wrote:
> > > >> >
> > > >> > > Hi all,
> > > >> > > The query for standard request handler is as follows
> > > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2)
> OR
> > > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4)
> > AND
> > > >> > > field5:(keyword5)
> > > >> > >
> > > >> > >
> > > >> > > How the same above query can be written for dismax request
> handler
> > > >> > >
> > > >> > > --
> > > >> > > Thanks & Regards,
> > > >> > > Isan Fulia.
> > > >> > >
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Thanks & Regards,
> > > >> Isan Fulia.
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Thanks & Regards,
> > Isan Fulia.
> >
>

RE: DismaxParser Query

Posted by Jonathan Rochkind <ro...@jhu.edu>.
Yes, I think nested queries are the only way to do that, and yes, nested queries like Daniel's example work (I've done it myself).  I haven't really tried to get into understanding/demonstrating _exactly_ how the relevance ends up working on the overall master query in such a situation, but it sort of works. 

(Just note that Daniel's example isn't quite right, I think you need double quotes for the nested _query_, just check the wiki page/blog post on nested queries). 

Does eDismax handle parens for order of operation too?  If so, eDismax is probably the best/easiest solution, especially if you're trying to parse an incoming query from some OTHER format and translate it to something that can be sent to Solr, which is what I often do. 

I haven't messed with eDismax myself yet.  Does anyone know if there's any easy (easy!) way to get eDismax in a Solr 1.4?  Any easy way to compile an eDismax query parser on it's own that works with Solr 1.4, and then just drop it into your local lib/ for use with an existing Solr 1.4?

Jonathan

________________________________________
From: Daniel Pötzinger [daniel.poetzinger@aoemedia.de]
Sent: Thursday, January 27, 2011 9:26 AM
To: solr-user@lucene.apache.org
Subject: AW: DismaxParser Query

It may also be an option to mix the query parsers?
Something like this (not tested):

q={!lucene}field1:test OR field2:test2 _query_:{!dismax qf=fields}+my dismax -bad

So you have the benefits of lucene and dismax parser

-----Ursprüngliche Nachricht-----
Von: Erick Erickson [mailto:erickerickson@gmail.com]
Gesendet: Donnerstag, 27. Januar 2011 15:15
An: solr-user@lucene.apache.org
Betreff: Re: DismaxParser Query

What version of Solr are you using, and could you consider either 3x or
applying a patch to 1.4.1? Because eDismax (extended dismax) handles the
full Lucene query language and probably works here. See the Solr
JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553

Best
Erick

On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <is...@germinait.com>wrote:

> It worked by making mm=0 (it acted as OR operator)
> but how to handle this
>
> field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
>
>
>
>
> On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> wrote:
>
> > sorry ignore that - we are on dismax here - look at mm param in the docs
> > you can set this to achieve what you need
> >
> > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > wrote:
> >
> > > the default operation can be set in your config to be "or" or on the
> > query
> > > something like q.op=OR
> > >
> > >
> > >
> > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
> > >
> > >> but q="keyword1 keyword2"  does AND operation  not OR
> > >>
> > >> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> > >> wrote:
> > >>
> > >> > use dismax q for first three fields and a filter query for the 4th
> and
> > >> 5th
> > >> > fields
> > >> > so
> > >> > q="keyword1 keyword 2"
> > >> > qf = field1,feild2,field3
> > >> > pf = field1,feild2,field3
> > >> > mm=something sensible for you
> > >> > defType=dismax
> > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > >> >
> > >> > take a look at the dismax docs for extra params
> > >> >
> > >> >
> > >> >
> > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > wrote:
> > >> >
> > >> > > Hi all,
> > >> > > The query for standard request handler is as follows
> > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4)
> AND
> > >> > > field5:(keyword5)
> > >> > >
> > >> > >
> > >> > > How the same above query can be written for dismax request handler
> > >> > >
> > >> > > --
> > >> > > Thanks & Regards,
> > >> > > Isan Fulia.
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Thanks & Regards,
> > >> Isan Fulia.
> > >>
> > >
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

AW: DismaxParser Query

Posted by Daniel Pötzinger <da...@aoemedia.de>.
It may also be an option to mix the query parsers?
Something like this (not tested):

q={!lucene}field1:test OR field2:test2 _query_:{!dismax qf=fields}+my dismax -bad

So you have the benefits of lucene and dismax parser

-----Ursprüngliche Nachricht-----
Von: Erick Erickson [mailto:erickerickson@gmail.com] 
Gesendet: Donnerstag, 27. Januar 2011 15:15
An: solr-user@lucene.apache.org
Betreff: Re: DismaxParser Query

What version of Solr are you using, and could you consider either 3x or
applying a patch to 1.4.1? Because eDismax (extended dismax) handles the
full Lucene query language and probably works here. See the Solr
JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553

Best
Erick

On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <is...@germinait.com>wrote:

> It worked by making mm=0 (it acted as OR operator)
> but how to handle this
>
> field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
>
>
>
>
> On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> wrote:
>
> > sorry ignore that - we are on dismax here - look at mm param in the docs
> > you can set this to achieve what you need
> >
> > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > wrote:
> >
> > > the default operation can be set in your config to be "or" or on the
> > query
> > > something like q.op=OR
> > >
> > >
> > >
> > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
> > >
> > >> but q="keyword1 keyword2"  does AND operation  not OR
> > >>
> > >> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> > >> wrote:
> > >>
> > >> > use dismax q for first three fields and a filter query for the 4th
> and
> > >> 5th
> > >> > fields
> > >> > so
> > >> > q="keyword1 keyword 2"
> > >> > qf = field1,feild2,field3
> > >> > pf = field1,feild2,field3
> > >> > mm=something sensible for you
> > >> > defType=dismax
> > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > >> >
> > >> > take a look at the dismax docs for extra params
> > >> >
> > >> >
> > >> >
> > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > wrote:
> > >> >
> > >> > > Hi all,
> > >> > > The query for standard request handler is as follows
> > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4)
> AND
> > >> > > field5:(keyword5)
> > >> > >
> > >> > >
> > >> > > How the same above query can be written for dismax request handler
> > >> > >
> > >> > > --
> > >> > > Thanks & Regards,
> > >> > > Isan Fulia.
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Thanks & Regards,
> > >> Isan Fulia.
> > >>
> > >
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by Erick Erickson <er...@gmail.com>.
What version of Solr are you using, and could you consider either 3x or
applying a patch to 1.4.1? Because eDismax (extended dismax) handles the
full Lucene query language and probably works here. See the Solr
JIRA 1553 at https://issues.apache.org/jira/browse/SOLR-1553

Best
Erick

On Thu, Jan 27, 2011 at 8:32 AM, Isan Fulia <is...@germinait.com>wrote:

> It worked by making mm=0 (it acted as OR operator)
> but how to handle this
>
> field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
>
>
>
>
> On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> wrote:
>
> > sorry ignore that - we are on dismax here - look at mm param in the docs
> > you can set this to achieve what you need
> >
> > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > wrote:
> >
> > > the default operation can be set in your config to be "or" or on the
> > query
> > > something like q.op=OR
> > >
> > >
> > >
> > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
> > >
> > >> but q="keyword1 keyword2"  does AND operation  not OR
> > >>
> > >> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> > >> wrote:
> > >>
> > >> > use dismax q for first three fields and a filter query for the 4th
> and
> > >> 5th
> > >> > fields
> > >> > so
> > >> > q="keyword1 keyword 2"
> > >> > qf = field1,feild2,field3
> > >> > pf = field1,feild2,field3
> > >> > mm=something sensible for you
> > >> > defType=dismax
> > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > >> >
> > >> > take a look at the dismax docs for extra params
> > >> >
> > >> >
> > >> >
> > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > wrote:
> > >> >
> > >> > > Hi all,
> > >> > > The query for standard request handler is as follows
> > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4)
> AND
> > >> > > field5:(keyword5)
> > >> > >
> > >> > >
> > >> > > How the same above query can be written for dismax request handler
> > >> > >
> > >> > > --
> > >> > > Thanks & Regards,
> > >> > > Isan Fulia.
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Thanks & Regards,
> > >> Isan Fulia.
> > >>
> > >
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by lee carroll <le...@googlemail.com>.
with dismax you get to say things like match all terms if less then 3 terms
entered else match term-x
it produces highly flexible and relevant matches and works very well in lots
of common search usescases. field boosting
allows further tuning.

if you have rigid rules like the last one you quote i don't think dismax is
for you. Although i might be wrong and some one might
be able to help



On 27 January 2011 13:32, Isan Fulia <is...@germinait.com> wrote:

> It worked by making mm=0 (it acted as OR operator)
> but how to handle this
>
> field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
> field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))
>
>
>
>
> On 27 January 2011 17:06, lee carroll <le...@googlemail.com>
> wrote:
>
> > sorry ignore that - we are on dismax here - look at mm param in the docs
> > you can set this to achieve what you need
> >
> > On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> > wrote:
> >
> > > the default operation can be set in your config to be "or" or on the
> > query
> > > something like q.op=OR
> > >
> > >
> > >
> > > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
> > >
> > >> but q="keyword1 keyword2"  does AND operation  not OR
> > >>
> > >> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> > >> wrote:
> > >>
> > >> > use dismax q for first three fields and a filter query for the 4th
> and
> > >> 5th
> > >> > fields
> > >> > so
> > >> > q="keyword1 keyword 2"
> > >> > qf = field1,feild2,field3
> > >> > pf = field1,feild2,field3
> > >> > mm=something sensible for you
> > >> > defType=dismax
> > >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> > >> >
> > >> > take a look at the dismax docs for extra params
> > >> >
> > >> >
> > >> >
> > >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> > wrote:
> > >> >
> > >> > > Hi all,
> > >> > > The query for standard request handler is as follows
> > >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4)
> AND
> > >> > > field5:(keyword5)
> > >> > >
> > >> > >
> > >> > > How the same above query can be written for dismax request handler
> > >> > >
> > >> > > --
> > >> > > Thanks & Regards,
> > >> > > Isan Fulia.
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Thanks & Regards,
> > >> Isan Fulia.
> > >>
> > >
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by Isan Fulia <is...@germinait.com>.
It worked by making mm=0 (it acted as OR operator)
but how to handle this

field1:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
field2:((keyword1 AND keyword2) OR (keyword3 AND keyword4)) OR
field3:((keyword1 AND keyword2) OR (keyword3 AND keyword4))




On 27 January 2011 17:06, lee carroll <le...@googlemail.com> wrote:

> sorry ignore that - we are on dismax here - look at mm param in the docs
> you can set this to achieve what you need
>
> On 27 January 2011 11:34, lee carroll <le...@googlemail.com>
> wrote:
>
> > the default operation can be set in your config to be "or" or on the
> query
> > something like q.op=OR
> >
> >
> >
> > On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
> >
> >> but q="keyword1 keyword2"  does AND operation  not OR
> >>
> >> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> >> wrote:
> >>
> >> > use dismax q for first three fields and a filter query for the 4th and
> >> 5th
> >> > fields
> >> > so
> >> > q="keyword1 keyword 2"
> >> > qf = field1,feild2,field3
> >> > pf = field1,feild2,field3
> >> > mm=something sensible for you
> >> > defType=dismax
> >> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> >> >
> >> > take a look at the dismax docs for extra params
> >> >
> >> >
> >> >
> >> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com>
> wrote:
> >> >
> >> > > Hi all,
> >> > > The query for standard request handler is as follows
> >> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> >> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
> >> > > field5:(keyword5)
> >> > >
> >> > >
> >> > > How the same above query can be written for dismax request handler
> >> > >
> >> > > --
> >> > > Thanks & Regards,
> >> > > Isan Fulia.
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Thanks & Regards,
> >> Isan Fulia.
> >>
> >
> >
>



-- 
Thanks & Regards,
Isan Fulia.

Re: DismaxParser Query

Posted by lee carroll <le...@googlemail.com>.
sorry ignore that - we are on dismax here - look at mm param in the docs
you can set this to achieve what you need

On 27 January 2011 11:34, lee carroll <le...@googlemail.com> wrote:

> the default operation can be set in your config to be "or" or on the query
> something like q.op=OR
>
>
>
> On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:
>
>> but q="keyword1 keyword2"  does AND operation  not OR
>>
>> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
>> wrote:
>>
>> > use dismax q for first three fields and a filter query for the 4th and
>> 5th
>> > fields
>> > so
>> > q="keyword1 keyword 2"
>> > qf = field1,feild2,field3
>> > pf = field1,feild2,field3
>> > mm=something sensible for you
>> > defType=dismax
>> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
>> >
>> > take a look at the dismax docs for extra params
>> >
>> >
>> >
>> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com> wrote:
>> >
>> > > Hi all,
>> > > The query for standard request handler is as follows
>> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
>> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
>> > > field5:(keyword5)
>> > >
>> > >
>> > > How the same above query can be written for dismax request handler
>> > >
>> > > --
>> > > Thanks & Regards,
>> > > Isan Fulia.
>> > >
>> >
>>
>>
>>
>> --
>> Thanks & Regards,
>> Isan Fulia.
>>
>
>

Re: DismaxParser Query

Posted by lee carroll <le...@googlemail.com>.
the default operation can be set in your config to be "or" or on the query
something like q.op=OR



On 27 January 2011 11:26, Isan Fulia <is...@germinait.com> wrote:

> but q="keyword1 keyword2"  does AND operation  not OR
>
> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> wrote:
>
> > use dismax q for first three fields and a filter query for the 4th and
> 5th
> > fields
> > so
> > q="keyword1 keyword 2"
> > qf = field1,feild2,field3
> > pf = field1,feild2,field3
> > mm=something sensible for you
> > defType=dismax
> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> >
> > take a look at the dismax docs for extra params
> >
> >
> >
> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com> wrote:
> >
> > > Hi all,
> > > The query for standard request handler is as follows
> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
> > > field5:(keyword5)
> > >
> > >
> > > How the same above query can be written for dismax request handler
> > >
> > > --
> > > Thanks & Regards,
> > > Isan Fulia.
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by Bijeet Singh <bi...@gmail.com>.
The DisMax query parser internally hard-codes its operator to OR.
This is quite unlike the Lucene query parser, for which the default operator
can be configured using the solrQueryParser in schema.xml

Regards,

Bijeet Singh

On Thu, Jan 27, 2011 at 4:56 PM, Isan Fulia <is...@germinait.com>wrote:

> but q="keyword1 keyword2"  does AND operation  not OR
>
> On 27 January 2011 16:22, lee carroll <le...@googlemail.com>
> wrote:
>
> > use dismax q for first three fields and a filter query for the 4th and
> 5th
> > fields
> > so
> > q="keyword1 keyword 2"
> > qf = field1,feild2,field3
> > pf = field1,feild2,field3
> > mm=something sensible for you
> > defType=dismax
> > fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
> >
> > take a look at the dismax docs for extra params
> >
> >
> >
> > On 27 January 2011 08:52, Isan Fulia <is...@germinait.com> wrote:
> >
> > > Hi all,
> > > The query for standard request handler is as follows
> > > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
> > > field5:(keyword5)
> > >
> > >
> > > How the same above query can be written for dismax request handler
> > >
> > > --
> > > Thanks & Regards,
> > > Isan Fulia.
> > >
> >
>
>
>
> --
> Thanks & Regards,
> Isan Fulia.
>

Re: DismaxParser Query

Posted by Isan Fulia <is...@germinait.com>.
but q="keyword1 keyword2"  does AND operation  not OR

On 27 January 2011 16:22, lee carroll <le...@googlemail.com> wrote:

> use dismax q for first three fields and a filter query for the 4th and 5th
> fields
> so
> q="keyword1 keyword 2"
> qf = field1,feild2,field3
> pf = field1,feild2,field3
> mm=something sensible for you
> defType=dismax
> fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"
>
> take a look at the dismax docs for extra params
>
>
>
> On 27 January 2011 08:52, Isan Fulia <is...@germinait.com> wrote:
>
> > Hi all,
> > The query for standard request handler is as follows
> > field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> > field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
> > field5:(keyword5)
> >
> >
> > How the same above query can be written for dismax request handler
> >
> > --
> > Thanks & Regards,
> > Isan Fulia.
> >
>



-- 
Thanks & Regards,
Isan Fulia.

Re: DismaxParser Query

Posted by lee carroll <le...@googlemail.com>.
use dismax q for first three fields and a filter query for the 4th and 5th
fields
so
q="keyword1 keyword 2"
qf = field1,feild2,field3
pf = field1,feild2,field3
mm=something sensible for you
defType=dismax
fq=" field4:(keyword3 OR keyword4) AND field5:(keyword5)"

take a look at the dismax docs for extra params



On 27 January 2011 08:52, Isan Fulia <is...@germinait.com> wrote:

> Hi all,
> The query for standard request handler is as follows
> field1:(keyword1 OR keyword2) OR field2:(keyword1 OR keyword2) OR
> field3:(keyword1 OR keyword2) AND field4:(keyword3 OR keyword4) AND
> field5:(keyword5)
>
>
> How the same above query can be written for dismax request handler
>
> --
> Thanks & Regards,
> Isan Fulia.
>