DisMax query parser syntax for the fq parameter

View: New views
3 Messages — Rating Filter:   Alert me  

DisMax query parser syntax for the fq parameter

by gistolero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

by Erik Hatcher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 9, 2009, at 1:02 PM, gistolero@... 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


Re: DisMax query parser syntax for the fq parameter

by gistolero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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