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 chris sleeman <ch...@gmail.com> on 2008/07/16 17:29:24 UTC
Multiple query fields in DisMax handler
Hi all,
Is there currently a way of specifying more than 1 user query fields (q
parameter) with the disMax request handler ?
Basically my requirement is this - I have 2 user query fields - 'query' and
'location', each of which corresponds to multiple solr query fields. The
'location' entered by user, for example, could be a city,state,address or a
zip code, each of which is a separate solr field. Similarly the user 'query'
field corresponds to multiple solr fields with different boosts.
Is it possible to use dismax for this? Any ideas or workarounds ?
Thanks in advance,
Chris
--
Laurence J. Peter - "Originality is the fine art of remembering what you
hear but forgetting where you heard it."
Re: Multiple query fields in DisMax handler
Posted by chris sleeman <ch...@gmail.com>.
Thanks a ton...this is quite useful.
Regards,
Chris
On Thu, Jul 17, 2008 at 6:42 PM, Yonik Seeley <yo...@apache.org> wrote:
> On Thu, Jul 17, 2008 at 8:11 AM, chris sleeman <ch...@gmail.com>
> wrote:
> > What I actually meant was whether or not I could create a configuration
> for
> > a dismax query parser and then refer to it in my filter query. I already
> > have a standard request handler with a "dismax" deftype for my query
> field.
> > I wanted to use another dismax parser for the fq param, on the lines of
> what
> > Ryan and Erik had suggested. Just dont want to specify all the params for
> > this dismax at query time.
>
> To separate the configuration from the client, you could at least grab
> the parameter values from config (you still would need to specify the
> parameter names though). For a filter, some of the params you would
> simply want to zero out.
>
> fq={!dismax qf=$filter_qf pf= bf=}CA
> and set filter_qf as a default in solrconfig.xml
> OR separating out the actual query value to make this easier to compose:
> fq={!dismax qf=$filter_qf pf= bf= v=$q2}&q2=CA
>
> That's currently the closest you can get out of the box I think.
>
> -Yonik
>
> > My actual query would then simply look like - "
> > http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismaxL%7DCA>",
> instead of
> > specifying all the qf, pf, etc fields as part of the dismax syntax within
> > the query.
> >
> > Regards,
> > Chris
> >
> > On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
> > wrote:
> >
> >> If I understand the question correctly, you can provide init params,
> >> default
> >> params and invariant params in the appropriate request handler section
> in
> >> solrconfig.xml.
> >> So you can create a standard request handler with name dismaxL, whose
> >> defType is dismax and set all parameters in defaults section.
> >>
> >> ------------
> >> Preetam
> >>
> >> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <chris.sleeman@gmail.com
> >
> >> wrote:
> >>
> >> > Thanks a lot..this is, more or less, what i was looking for.
> >> >
> >> > However, is there a way to pre-configure the dismax query parser, with
> >> > parameters like qf, pf, boost etc., in solr-config.xml, rather than
> doing
> >> > so
> >> > at query time. So my actual query would look like - <
> >> > http://localhost:8983/solr/select?q=<
> >> >
> >>
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >> > >
> >> > query&fq={!dismaxL}CA&debugQuery=true<
> >> >
> >>
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >> > >>,
> >> > where dismaxL refers to a query parser defined in solrconfig, with all
> >> the
> >> > necessary parameters. The q parameter would then use the default
> dismax
> >> > parser defined for the handler and fq would use dismaxL.
> >> >
> >> > Regards,
> >> > Chris
> >> >
> >> > On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
> >> erik@ehatchersolutions.com>
> >> > wrote:
> >> >
> >> > > On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
> >> > >
> >> > >> (assuming you are using 1.3-dev), you could use the dismax query
> >> parser
> >> > >> syntax for the fq param. I think it is something like:
> >> > >> fq=<!dismax>your query
> >> > >>
> >> > >
> >> > > The latest committed syntax is:
> >> > >
> >> > > {!dismax qf="...."}your query
> >> > >
> >> > > For example, with the sample data: <
> >> > >
> >> >
> >>
> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
> <
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >
> >> <
> >>
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >> >
> >> > <
> >> >
> >>
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >> > >
> >> > > >
> >> > >
> >> > > I can't find the syntax now (Yonik?)
> >> > >>
> >> > >> but I don't know how you could pull out the qf,pf,etc fields for
> the
> >> fq
> >> > >> portion vs the q portion.
> >> > >>
> >> > >
> >> > > You can add parameters like the qf above, within the {!dismax ... }
> >> area.
> >> > >
> >> > > Erik
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> > Bill Cosby - "Advertising is the most fun you can have with your
> clothes
> >> > on."
> >> >
> >>
> >
> >
> >
> > --
> > Yogi Berra - "A nickel ain't worth a dime anymore."
> >
>
--
Yogi Berra - "A nickel ain't worth a dime anymore."
Re: Multiple query fields in DisMax handler
Posted by Yonik Seeley <yo...@apache.org>.
On Thu, Jul 17, 2008 at 8:11 AM, chris sleeman <ch...@gmail.com> wrote:
> What I actually meant was whether or not I could create a configuration for
> a dismax query parser and then refer to it in my filter query. I already
> have a standard request handler with a "dismax" deftype for my query field.
> I wanted to use another dismax parser for the fq param, on the lines of what
> Ryan and Erik had suggested. Just dont want to specify all the params for
> this dismax at query time.
To separate the configuration from the client, you could at least grab
the parameter values from config (you still would need to specify the
parameter names though). For a filter, some of the params you would
simply want to zero out.
fq={!dismax qf=$filter_qf pf= bf=}CA
and set filter_qf as a default in solrconfig.xml
OR separating out the actual query value to make this easier to compose:
fq={!dismax qf=$filter_qf pf= bf= v=$q2}&q2=CA
That's currently the closest you can get out of the box I think.
-Yonik
> My actual query would then simply look like - "
> http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA", instead of
> specifying all the qf, pf, etc fields as part of the dismax syntax within
> the query.
>
> Regards,
> Chris
>
> On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
> wrote:
>
>> If I understand the question correctly, you can provide init params,
>> default
>> params and invariant params in the appropriate request handler section in
>> solrconfig.xml.
>> So you can create a standard request handler with name dismaxL, whose
>> defType is dismax and set all parameters in defaults section.
>>
>> ------------
>> Preetam
>>
>> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <ch...@gmail.com>
>> wrote:
>>
>> > Thanks a lot..this is, more or less, what i was looking for.
>> >
>> > However, is there a way to pre-configure the dismax query parser, with
>> > parameters like qf, pf, boost etc., in solr-config.xml, rather than doing
>> > so
>> > at query time. So my actual query would look like - <
>> > http://localhost:8983/solr/select?q=<
>> >
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>> > >
>> > query&fq={!dismaxL}CA&debugQuery=true<
>> >
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>> > >>,
>> > where dismaxL refers to a query parser defined in solrconfig, with all
>> the
>> > necessary parameters. The q parameter would then use the default dismax
>> > parser defined for the handler and fq would use dismaxL.
>> >
>> > Regards,
>> > Chris
>> >
>> > On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
>> erik@ehatchersolutions.com>
>> > wrote:
>> >
>> > > On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
>> > >
>> > >> (assuming you are using 1.3-dev), you could use the dismax query
>> parser
>> > >> syntax for the fq param. I think it is something like:
>> > >> fq=<!dismax>your query
>> > >>
>> > >
>> > > The latest committed syntax is:
>> > >
>> > > {!dismax qf="...."}your query
>> > >
>> > > For example, with the sample data: <
>> > >
>> >
>> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
>> <
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>> >
>> > <
>> >
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>> > >
>> > > >
>> > >
>> > > I can't find the syntax now (Yonik?)
>> > >>
>> > >> but I don't know how you could pull out the qf,pf,etc fields for the
>> fq
>> > >> portion vs the q portion.
>> > >>
>> > >
>> > > You can add parameters like the qf above, within the {!dismax ... }
>> area.
>> > >
>> > > Erik
>> > >
>> > >
>> >
>> >
>> > --
>> > Bill Cosby - "Advertising is the most fun you can have with your clothes
>> > on."
>> >
>>
>
>
>
> --
> Yogi Berra - "A nickel ain't worth a dime anymore."
>
Re: Multiple query fields in DisMax handler
Posted by Preetam Rao <bl...@gmail.com>.
Oops.. this will only help you configure only the defaults common to the
main dismax query as well as the fq dismax query.
For creating two sets of dismax parsers which are named and want to read
params from solrconfig, I think one can extend the dismaxQParser's currently
empty init() method to setup the param hierarchy during the query time such
that the lookup chain becomes - local params, then qparser init params and
then request params. It is along similar lines to Eric's suggestion. But I
am not sure if we want to create a custom parser for this or make it a
general behavior..
---------------
preetam
On Thu, Jul 17, 2008 at 6:21 PM, Preetam Rao <bl...@gmail.com>
wrote:
> I see that a QParser takes local params (those given via {!...} )as well as
> request params. It sets the lookup chain as local followed be request
> params. AFAIK, the request param lookup chain is set up as -
> those given in the url explicitly, then invariants, then defaults gievn in
> solrconfig for the corresponding request handler.
>
> Since you are not using dismax params for the main query and just want them
> to be available for the Dismax parser, there are no conflicts and I think
> you can set the qf, bf etc in the named standard request handler that you
> are configuring in solrconfig and dismax query parser will automatically
> pick it up.
>
> --------------
> Preetam
>
>
>
> On Thu, Jul 17, 2008 at 5:48 PM, Erik Hatcher <er...@ehatchersolutions.com>
> wrote:
>
>> A custom QParserPlugin could be created and implement an #init(NamedList)
>> which you could parameterize via it's solrconfig.xml configuration. That
>> would be one way. Another trick, I think, would be to use request
>> parameter substitution. The javadocs here might lead you to what you're
>> after:
>>
>> <
>> http://lucene.apache.org/solr/api/org/apache/solr/search/NestedQParserPlugin.html
>> >
>>
>> I've not tinkered with this stuff myself other than a bit of trying to
>> grok the capabilities Yonik built into this stuff, so having folks post back
>> their experiences would be helpful to us all :)
>>
>> Erik
>>
>>
>>
>> On Jul 17, 2008, at 8:11 AM, chris sleeman wrote:
>>
>>> What I actually meant was whether or not I could create a configuration
>>> for
>>> a dismax query parser and then refer to it in my filter query. I already
>>> have a standard request handler with a "dismax" deftype for my query
>>> field.
>>> I wanted to use another dismax parser for the fq param, on the lines of
>>> what
>>> Ryan and Erik had suggested. Just dont want to specify all the params for
>>> this dismax at query time.
>>>
>>> My actual query would then simply look like - "
>>> http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismaxL%7DCA>",
>>> instead of
>>> specifying all the qf, pf, etc fields as part of the dismax syntax within
>>> the query.
>>>
>>> Regards,
>>> Chris
>>>
>>> On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
>>> wrote:
>>>
>>> If I understand the question correctly, you can provide init params,
>>>> default
>>>> params and invariant params in the appropriate request handler section
>>>> in
>>>> solrconfig.xml.
>>>> So you can create a standard request handler with name dismaxL, whose
>>>> defType is dismax and set all parameters in defaults section.
>>>>
>>>> ------------
>>>> Preetam
>>>>
>>>> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <chris.sleeman@gmail.com
>>>> >
>>>> wrote:
>>>>
>>>> Thanks a lot..this is, more or less, what i was looking for.
>>>>>
>>>>> However, is there a way to pre-configure the dismax query parser, with
>>>>> parameters like qf, pf, boost etc., in solr-config.xml, rather than
>>>>> doing
>>>>> so
>>>>> at query time. So my actual query would look like - <
>>>>> http://localhost:8983/solr/select?q=<
>>>>>
>>>>>
>>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>>>>
>>>>>> query&fq={!dismaxL}CA&debugQuery=true<
>>>>>
>>>>>
>>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>>>> ,
>>>>>>>
>>>>>> where dismaxL refers to a query parser defined in solrconfig, with all
>>>>>
>>>> the
>>>>
>>>>> necessary parameters. The q parameter would then use the default dismax
>>>>> parser defined for the handler and fq would use dismaxL.
>>>>>
>>>>> Regards,
>>>>> Chris
>>>>>
>>>>> On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
>>>>>
>>>> erik@ehatchersolutions.com>
>>>>
>>>>> wrote:
>>>>>
>>>>> On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
>>>>>>
>>>>>> (assuming you are using 1.3-dev), you could use the dismax query
>>>>>>>
>>>>>> parser
>>>>
>>>>> syntax for the fq param. I think it is something like:
>>>>>>> fq=<!dismax>your query
>>>>>>>
>>>>>>>
>>>>>> The latest committed syntax is:
>>>>>>
>>>>>> {!dismax qf="...."}your query
>>>>>>
>>>>>> For example, with the sample data: <
>>>>>>
>>>>>>
>>>>> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name>
>>>> %22}ipod&debugQuery=true<
>>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>> >
>>>> <
>>>>
>>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>>>>
>>>>> <
>>>>>
>>>>>
>>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>>>>
>>>>>>
>>>>>>>
>>>>>> I can't find the syntax now (Yonik?)
>>>>>>
>>>>>>>
>>>>>>> but I don't know how you could pull out the qf,pf,etc fields for the
>>>>>>>
>>>>>> fq
>>>>
>>>>> portion vs the q portion.
>>>>>>>
>>>>>>>
>>>>>> You can add parameters like the qf above, within the {!dismax ... }
>>>>>>
>>>>> area.
>>>>
>>>>>
>>>>>> Erik
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Bill Cosby - "Advertising is the most fun you can have with your
>>>>> clothes
>>>>> on."
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Yogi Berra - "A nickel ain't worth a dime anymore."
>>>
>>
>>
>
Re: Multiple query fields in DisMax handler
Posted by Preetam Rao <bl...@gmail.com>.
I see that a QParser takes local params (those given via {!...} )as well as
request params. It sets the lookup chain as local followed be request
params. AFAIK, the request param lookup chain is set up as -
those given in the url explicitly, then invariants, then defaults gievn in
solrconfig for the corresponding request handler.
Since you are not using dismax params for the main query and just want them
to be available for the Dismax parser, there are no conflicts and I think
you can set the qf, bf etc in the named standard request handler that you
are configuring in solrconfig and dismax query parser will automatically
pick it up.
--------------
Preetam
On Thu, Jul 17, 2008 at 5:48 PM, Erik Hatcher <er...@ehatchersolutions.com>
wrote:
> A custom QParserPlugin could be created and implement an #init(NamedList)
> which you could parameterize via it's solrconfig.xml configuration. That
> would be one way. Another trick, I think, would be to use request
> parameter substitution. The javadocs here might lead you to what you're
> after:
>
> <
> http://lucene.apache.org/solr/api/org/apache/solr/search/NestedQParserPlugin.html
> >
>
> I've not tinkered with this stuff myself other than a bit of trying to grok
> the capabilities Yonik built into this stuff, so having folks post back
> their experiences would be helpful to us all :)
>
> Erik
>
>
>
> On Jul 17, 2008, at 8:11 AM, chris sleeman wrote:
>
>> What I actually meant was whether or not I could create a configuration
>> for
>> a dismax query parser and then refer to it in my filter query. I already
>> have a standard request handler with a "dismax" deftype for my query
>> field.
>> I wanted to use another dismax parser for the fq param, on the lines of
>> what
>> Ryan and Erik had suggested. Just dont want to specify all the params for
>> this dismax at query time.
>>
>> My actual query would then simply look like - "
>> http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismaxL%7DCA>",
>> instead of
>> specifying all the qf, pf, etc fields as part of the dismax syntax within
>> the query.
>>
>> Regards,
>> Chris
>>
>> On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
>> wrote:
>>
>> If I understand the question correctly, you can provide init params,
>>> default
>>> params and invariant params in the appropriate request handler section in
>>> solrconfig.xml.
>>> So you can create a standard request handler with name dismaxL, whose
>>> defType is dismax and set all parameters in defaults section.
>>>
>>> ------------
>>> Preetam
>>>
>>> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <ch...@gmail.com>
>>> wrote:
>>>
>>> Thanks a lot..this is, more or less, what i was looking for.
>>>>
>>>> However, is there a way to pre-configure the dismax query parser, with
>>>> parameters like qf, pf, boost etc., in solr-config.xml, rather than
>>>> doing
>>>> so
>>>> at query time. So my actual query would look like - <
>>>> http://localhost:8983/solr/select?q=<
>>>>
>>>>
>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>
>>>>
>>>>> query&fq={!dismaxL}CA&debugQuery=true<
>>>>
>>>>
>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>
>>>> ,
>>>>>>
>>>>> where dismaxL refers to a query parser defined in solrconfig, with all
>>>>
>>> the
>>>
>>>> necessary parameters. The q parameter would then use the default dismax
>>>> parser defined for the handler and fq would use dismaxL.
>>>>
>>>> Regards,
>>>> Chris
>>>>
>>>> On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
>>>>
>>> erik@ehatchersolutions.com>
>>>
>>>> wrote:
>>>>
>>>> On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
>>>>>
>>>>> (assuming you are using 1.3-dev), you could use the dismax query
>>>>>>
>>>>> parser
>>>
>>>> syntax for the fq param. I think it is something like:
>>>>>> fq=<!dismax>your query
>>>>>>
>>>>>>
>>>>> The latest committed syntax is:
>>>>>
>>>>> {!dismax qf="...."}your query
>>>>>
>>>>> For example, with the sample data: <
>>>>>
>>>>>
>>>> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name>
>>> %22}ipod&debugQuery=true<
>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>> >
>>> <
>>>
>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>
>>>>
>>>> <
>>>>
>>>>
>>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>
>>>>
>>>>>
>>>>>>
>>>>> I can't find the syntax now (Yonik?)
>>>>>
>>>>>>
>>>>>> but I don't know how you could pull out the qf,pf,etc fields for the
>>>>>>
>>>>> fq
>>>
>>>> portion vs the q portion.
>>>>>>
>>>>>>
>>>>> You can add parameters like the qf above, within the {!dismax ... }
>>>>>
>>>> area.
>>>
>>>>
>>>>> Erik
>>>>>
>>>>>
>>>>>
>>>>
>>>> --
>>>> Bill Cosby - "Advertising is the most fun you can have with your
>>>> clothes
>>>> on."
>>>>
>>>>
>>>
>>
>>
>> --
>> Yogi Berra - "A nickel ain't worth a dime anymore."
>>
>
>
Re: Multiple query fields in DisMax handler
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
A custom QParserPlugin could be created and implement an
#init(NamedList) which you could parameterize via it's solrconfig.xml
configuration. That would be one way. Another trick, I think,
would be to use request parameter substitution. The javadocs here
might lead you to what you're after:
<http://lucene.apache.org/solr/api/org/apache/solr/search/NestedQParserPlugin.html
>
I've not tinkered with this stuff myself other than a bit of trying to
grok the capabilities Yonik built into this stuff, so having folks
post back their experiences would be helpful to us all :)
Erik
On Jul 17, 2008, at 8:11 AM, chris sleeman wrote:
> What I actually meant was whether or not I could create a
> configuration for
> a dismax query parser and then refer to it in my filter query. I
> already
> have a standard request handler with a "dismax" deftype for my query
> field.
> I wanted to use another dismax parser for the fq param, on the lines
> of what
> Ryan and Erik had suggested. Just dont want to specify all the
> params for
> this dismax at query time.
>
> My actual query would then simply look like - "
> http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA", instead of
> specifying all the qf, pf, etc fields as part of the dismax syntax
> within
> the query.
>
> Regards,
> Chris
>
> On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
> wrote:
>
>> If I understand the question correctly, you can provide init params,
>> default
>> params and invariant params in the appropriate request handler
>> section in
>> solrconfig.xml.
>> So you can create a standard request handler with name dismaxL, whose
>> defType is dismax and set all parameters in defaults section.
>>
>> ------------
>> Preetam
>>
>> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <chris.sleeman@gmail.com
>> >
>> wrote:
>>
>>> Thanks a lot..this is, more or less, what i was looking for.
>>>
>>> However, is there a way to pre-configure the dismax query parser,
>>> with
>>> parameters like qf, pf, boost etc., in solr-config.xml, rather
>>> than doing
>>> so
>>> at query time. So my actual query would look like - <
>>> http://localhost:8983/solr/select?q=<
>>>
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>> query&fq={!dismaxL}CA&debugQuery=true<
>>>
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>> ,
>>> where dismaxL refers to a query parser defined in solrconfig, with
>>> all
>> the
>>> necessary parameters. The q parameter would then use the default
>>> dismax
>>> parser defined for the handler and fq would use dismaxL.
>>>
>>> Regards,
>>> Chris
>>>
>>> On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
>> erik@ehatchersolutions.com>
>>> wrote:
>>>
>>>> On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
>>>>
>>>>> (assuming you are using 1.3-dev), you could use the dismax query
>> parser
>>>>> syntax for the fq param. I think it is something like:
>>>>> fq=<!dismax>your query
>>>>>
>>>>
>>>> The latest committed syntax is:
>>>>
>>>> {!dismax qf="...."}your query
>>>>
>>>> For example, with the sample data: <
>>>>
>>>
>> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name
>> %22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>> >
>> <
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>
>>> <
>>>
>> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
>>>>
>>>>>
>>>>
>>>> I can't find the syntax now (Yonik?)
>>>>>
>>>>> but I don't know how you could pull out the qf,pf,etc fields for
>>>>> the
>> fq
>>>>> portion vs the q portion.
>>>>>
>>>>
>>>> You can add parameters like the qf above, within the {!dismax ... }
>> area.
>>>>
>>>> Erik
>>>>
>>>>
>>>
>>>
>>> --
>>> Bill Cosby - "Advertising is the most fun you can have with your
>>> clothes
>>> on."
>>>
>>
>
>
>
> --
> Yogi Berra - "A nickel ain't worth a dime anymore."
Re: Multiple query fields in DisMax handler
Posted by chris sleeman <ch...@gmail.com>.
What I actually meant was whether or not I could create a configuration for
a dismax query parser and then refer to it in my filter query. I already
have a standard request handler with a "dismax" deftype for my query field.
I wanted to use another dismax parser for the fq param, on the lines of what
Ryan and Erik had suggested. Just dont want to specify all the params for
this dismax at query time.
My actual query would then simply look like - "
http://localhost:8983/solr/select?q=*:*&fq={!dismaxL}CA", instead of
specifying all the qf, pf, etc fields as part of the dismax syntax within
the query.
Regards,
Chris
On Thu, Jul 17, 2008 at 5:18 PM, Preetam Rao <bl...@gmail.com>
wrote:
> If I understand the question correctly, you can provide init params,
> default
> params and invariant params in the appropriate request handler section in
> solrconfig.xml.
> So you can create a standard request handler with name dismaxL, whose
> defType is dismax and set all parameters in defaults section.
>
> ------------
> Preetam
>
> On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <ch...@gmail.com>
> wrote:
>
> > Thanks a lot..this is, more or less, what i was looking for.
> >
> > However, is there a way to pre-configure the dismax query parser, with
> > parameters like qf, pf, boost etc., in solr-config.xml, rather than doing
> > so
> > at query time. So my actual query would look like - <
> > http://localhost:8983/solr/select?q=<
> >
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> > >
> > query&fq={!dismaxL}CA&debugQuery=true<
> >
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> > >>,
> > where dismaxL refers to a query parser defined in solrconfig, with all
> the
> > necessary parameters. The q parameter would then use the default dismax
> > parser defined for the handler and fq would use dismaxL.
> >
> > Regards,
> > Chris
> >
> > On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <
> erik@ehatchersolutions.com>
> > wrote:
> >
> > > On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
> > >
> > >> (assuming you are using 1.3-dev), you could use the dismax query
> parser
> > >> syntax for the fq param. I think it is something like:
> > >> fq=<!dismax>your query
> > >>
> > >
> > > The latest committed syntax is:
> > >
> > > {!dismax qf="...."}your query
> > >
> > > For example, with the sample data: <
> > >
> >
> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
> <
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >
> > <
> >
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> > >
> > > >
> > >
> > > I can't find the syntax now (Yonik?)
> > >>
> > >> but I don't know how you could pull out the qf,pf,etc fields for the
> fq
> > >> portion vs the q portion.
> > >>
> > >
> > > You can add parameters like the qf above, within the {!dismax ... }
> area.
> > >
> > > Erik
> > >
> > >
> >
> >
> > --
> > Bill Cosby - "Advertising is the most fun you can have with your clothes
> > on."
> >
>
--
Yogi Berra - "A nickel ain't worth a dime anymore."
Re: Multiple query fields in DisMax handler
Posted by Preetam Rao <bl...@gmail.com>.
If I understand the question correctly, you can provide init params, default
params and invariant params in the appropriate request handler section in
solrconfig.xml.
So you can create a standard request handler with name dismaxL, whose
defType is dismax and set all parameters in defaults section.
------------
Preetam
On Thu, Jul 17, 2008 at 4:35 PM, chris sleeman <ch...@gmail.com>
wrote:
> Thanks a lot..this is, more or less, what i was looking for.
>
> However, is there a way to pre-configure the dismax query parser, with
> parameters like qf, pf, boost etc., in solr-config.xml, rather than doing
> so
> at query time. So my actual query would look like - <
> http://localhost:8983/solr/select?q=<
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >
> query&fq={!dismaxL}CA&debugQuery=true<
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >>,
> where dismaxL refers to a query parser defined in solrconfig, with all the
> necessary parameters. The q parameter would then use the default dismax
> parser defined for the handler and fq would use dismaxL.
>
> Regards,
> Chris
>
> On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <er...@ehatchersolutions.com>
> wrote:
>
> > On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
> >
> >> (assuming you are using 1.3-dev), you could use the dismax query parser
> >> syntax for the fq param. I think it is something like:
> >> fq=<!dismax>your query
> >>
> >
> > The latest committed syntax is:
> >
> > {!dismax qf="...."}your query
> >
> > For example, with the sample data: <
> >
> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
> <
> http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true
> >
> > >
> >
> > I can't find the syntax now (Yonik?)
> >>
> >> but I don't know how you could pull out the qf,pf,etc fields for the fq
> >> portion vs the q portion.
> >>
> >
> > You can add parameters like the qf above, within the {!dismax ... } area.
> >
> > Erik
> >
> >
>
>
> --
> Bill Cosby - "Advertising is the most fun you can have with your clothes
> on."
>
Re: Multiple query fields in DisMax handler
Posted by chris sleeman <ch...@gmail.com>.
Thanks a lot..this is, more or less, what i was looking for.
However, is there a way to pre-configure the dismax query parser, with
parameters like qf, pf, boost etc., in solr-config.xml, rather than doing so
at query time. So my actual query would look like - <
http://localhost:8983/solr/select?q=<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
query&fq={!dismaxL}CA&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>>,
where dismaxL refers to a query parser defined in solrconfig, with all the
necessary parameters. The q parameter would then use the default dismax
parser defined for the handler and fq would use dismaxL.
Regards,
Chris
On Thu, Jul 17, 2008 at 5:15 AM, Erik Hatcher <er...@ehatchersolutions.com>
wrote:
> On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
>
>> (assuming you are using 1.3-dev), you could use the dismax query parser
>> syntax for the fq param. I think it is something like:
>> fq=<!dismax>your query
>>
>
> The latest committed syntax is:
>
> {!dismax qf="...."}your query
>
> For example, with the sample data: <
> http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true<http://localhost:8983/solr/select?q=*:*&fq=%7B%21dismax%20qf=%22name%22%7Dipod&debugQuery=true>
> >
>
> I can't find the syntax now (Yonik?)
>>
>> but I don't know how you could pull out the qf,pf,etc fields for the fq
>> portion vs the q portion.
>>
>
> You can add parameters like the qf above, within the {!dismax ... } area.
>
> Erik
>
>
--
Bill Cosby - "Advertising is the most fun you can have with your clothes
on."
Re: Multiple query fields in DisMax handler
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 16, 2008, at 7:38 PM, Ryan McKinley wrote:
> (assuming you are using 1.3-dev), you could use the dismax query
> parser syntax for the fq param. I think it is something like:
> fq=<!dismax>your query
The latest committed syntax is:
{!dismax qf="...."}your query
For example, with the sample data: <http://localhost:8983/solr/select?q=*:*&fq={!dismax%20qf=%22name%22}ipod&debugQuery=true
>
> I can't find the syntax now (Yonik?)
>
> but I don't know how you could pull out the qf,pf,etc fields for the
> fq portion vs the q portion.
You can add parameters like the qf above, within the {!dismax ... }
area.
Erik
Re: Multiple query fields in DisMax handler
Posted by Ryan McKinley <ry...@gmail.com>.
(assuming you are using 1.3-dev), you could use the dismax query
parser syntax for the fq param. I think it is something like:
fq=<!dismax>your query
I can't find the syntax now (Yonik?)
but I don't know how you could pull out the qf,pf,etc fields for the
fq portion vs the q portion.
On Jul 16, 2008, at 10:29 AM, chris sleeman wrote:
> Hi all,
>
> Is there currently a way of specifying more than 1 user query fields
> (q
> parameter) with the disMax request handler ?
> Basically my requirement is this - I have 2 user query fields -
> 'query' and
> 'location', each of which corresponds to multiple solr query fields.
> The
> 'location' entered by user, for example, could be a
> city,state,address or a
> zip code, each of which is a separate solr field. Similarly the user
> 'query'
> field corresponds to multiple solr fields with different boosts.
> Is it possible to use dismax for this? Any ideas or workarounds ?
>
> Thanks in advance,
> Chris
>
> --
> Laurence J. Peter - "Originality is the fine art of remembering
> what you
> hear but forgetting where you heard it."
Re: Multiple query fields in DisMax handler
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
There are also likely some way wacky things you could do with mixing
and matching query parsers even within a "q". FunctionQParser and
friends probably hold some crazy voodoo.
Erik
On Jul 16, 2008, at 1:29 PM, Shalin Shekhar Mangar wrote:
> Is it possible to use fq parameters for filtering on the address
> fields?
> Then the q and other dismax params can be used for your main query.
>
> On Wed, Jul 16, 2008 at 8:59 PM, chris sleeman <chris.sleeman@gmail.com
> >
> wrote:
>
>> Hi all,
>>
>> Is there currently a way of specifying more than 1 user query
>> fields (q
>> parameter) with the disMax request handler ?
>> Basically my requirement is this - I have 2 user query fields -
>> 'query' and
>> 'location', each of which corresponds to multiple solr query
>> fields. The
>> 'location' entered by user, for example, could be a
>> city,state,address or a
>> zip code, each of which is a separate solr field. Similarly the user
>> 'query'
>> field corresponds to multiple solr fields with different boosts.
>> Is it possible to use dismax for this? Any ideas or workarounds ?
>>
>> Thanks in advance,
>> Chris
>>
>> --
>> Laurence J. Peter - "Originality is the fine art of remembering
>> what you
>> hear but forgetting where you heard it."
>>
>
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
Re: Multiple query fields in DisMax handler
Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Is it possible to use fq parameters for filtering on the address fields?
Then the q and other dismax params can be used for your main query.
On Wed, Jul 16, 2008 at 8:59 PM, chris sleeman <ch...@gmail.com>
wrote:
> Hi all,
>
> Is there currently a way of specifying more than 1 user query fields (q
> parameter) with the disMax request handler ?
> Basically my requirement is this - I have 2 user query fields - 'query' and
> 'location', each of which corresponds to multiple solr query fields. The
> 'location' entered by user, for example, could be a city,state,address or a
> zip code, each of which is a separate solr field. Similarly the user
> 'query'
> field corresponds to multiple solr fields with different boosts.
> Is it possible to use dismax for this? Any ideas or workarounds ?
>
> Thanks in advance,
> Chris
>
> --
> Laurence J. Peter - "Originality is the fine art of remembering what you
> hear but forgetting where you heard it."
>
--
Regards,
Shalin Shekhar Mangar.