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 <[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
%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."