Thanks a ton...this is quite useful. Regards, Chris
On Thu, Jul 17, 2008 at 6:42 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote: > On Thu, Jul 17, 2008 at 8:11 AM, chris sleeman <[EMAIL PROTECTED]> > 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 <[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 > >> > > >> > < > >> > > >> > 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."