lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: Nested function query must use ....
Date Fri, 01 Feb 2013 23:46:01 GMT
You have to do exactly what the error message tells you:

rewrite:

    query(id:3)

as:

    query({!=v'id:3'})

I've updated the example on the Function Query wiki that you may have 
copied:
http://wiki.apache.org/solr/FunctionQuery#exists

-- Jack Krupansky

-----Original Message----- 
From: Uwe Reh
Sent: Friday, February 01, 2013 4:35 PM
To: solr-user@lucene.apache.org
Subject: Nested function query must use ....

Hi,

should be easy, but I'm to blind to find the correct syntax (Solr4.1)

Problem:
I' have some documents in the index, because of their structure they
tend to get too high scores. This documents are easy to identify and I
want to boost the others to get a fair ranking.

Could anyone give my the correct syntax to accomplish this simplified
query?  "...q=*:*&fl=foo:exists(query(id:3))"

Uwe

Example:
> <response>
> <lst name="responseHeader">
>   <int name="status">400</int>
>   <int name="QTime">2</int>
>   <lst name="params">
>     <str name="fl">foo:exists(query(id:3))</str>
>     <str name="q">*:*</str>
>   </lst>
> </lst>
> <lst name="error">
>   <str name="msg">Error parsing fieldname: Nested function query must use 
> $param or {!v=value} forms. got 'exists(query(id:3))'</str>
>   <int name="code">400</int>
> </lst>
> </response>

But "...q=*:*&fl=foo:exists(id)" works
> <response>
> <lst name="responseHeader">
>   <int name="status">0</int>
>   <int name="QTime">1</int>
>   <lst name="params">
>     <str name="fl">foo:exists(id)</str>
>     <str name="q">*:*</str>
>     <str name="rows">1</str>
>   </lst>
> </lst>
> <result name="response" numFound="17322225" start="0">
>   <doc>
>     <bool name="foo">true</bool></doc>
> </result>
> </response> 


Mime
View raw message