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 gi...@gmx.de on 2009/07/09 19:02:04 UTC

DisMax query parser syntax for the fq parameter

Hello,

I am using the dismax query parser syntax for the fq param:

.../select?qt=dismax&rows=30&q.alt=*:*&qf=content&fq={!dismax qf=contentKeyword^1.0 mm=0%}Foo&fq=+date:[2009-03-11T00:00:00Z TO 2009-07-09T16:41:50Z]&fl=id,date,content


Now, I want to add one more field to the qf parameter:

...&fq={!dismax qf=titleKeyword^1.8 contentKeyword^1.0 mm=0%}Foo&...

=> Solr should return a doc, if "titleKeyword" OR "contentKeyword" contains "Foo".


But this results in an error:

SEVERE: org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException: Expected identifier
at pos 43 str='{!dismax qf=titleKeyword^1.8 contentKeyword^1.0 mm=0%}Foo'

Is it possible to use the fq filter for multiple fields?

Thanks
Gisto
-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

Re: DisMax query parser syntax for the fq parameter

Posted by gi...@gmx.de.
Yes, it works :-) Thanks Erik!


> > I am using the dismax query parser syntax for the fq param:
> >
> > .../select?qt=dismax&rows=30&q.alt=*:*&qf=content&fq={!dismax  
> > qf=contentKeyword^1.0 mm=0%}Foo&fq=+date:[2009-03-11T00:00:00Z TO  
> > 2009-07-09T16:41:50Z]&fl=id,date,content
> >
> >
> > Now, I want to add one more field to the qf parameter:
> >
> > ...&fq={!dismax qf=titleKeyword^1.8 contentKeyword^1.0 mm=0%}Foo&...
> 
> The issue is that qf needs to have spaces in it, but the local params  
> can't deal with that.  So what you can do is fq={!dismax qf=$fqqf  
> mm=0%}Foo&fqqf=titleKeyword^1.8+contentKeyword^1.0 - hope that works  
> (just typing that without trying it).
> 
> 	Erik

-- 
Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02

Re: DisMax query parser syntax for the fq parameter

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 9, 2009, at 1:02 PM, gistolero@gmx.de wrote:
> I am using the dismax query parser syntax for the fq param:
>
> .../select?qt=dismax&rows=30&q.alt=*:*&qf=content&fq={!dismax  
> qf=contentKeyword^1.0 mm=0%}Foo&fq=+date:[2009-03-11T00:00:00Z TO  
> 2009-07-09T16:41:50Z]&fl=id,date,content
>
>
> Now, I want to add one more field to the qf parameter:
>
> ...&fq={!dismax qf=titleKeyword^1.8 contentKeyword^1.0 mm=0%}Foo&...

The issue is that qf needs to have spaces in it, but the local params  
can't deal with that.  So what you can do is fq={!dismax qf=$fqqf  
mm=0%}Foo&fqqf=titleKeyword^1.8+contentKeyword^1.0 - hope that works  
(just typing that without trying it).

	Erik