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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>
>>> 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 <[EMAIL PROTECTED]
>>>> >
>>>> 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 <
>>>>>
>>>> [EMAIL PROTECTED]>
>>>>
>>>>> 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."
>>>
>>
>>
>

Reply via email to