Thanks very much; that does indeed work as I'd hoped/expected.

On 7 August 2012 17:12, Yonik Seeley <yo...@lucidimagination.com> wrote:
> On Tue, Aug 7, 2012 at 3:01 PM, Timothy Hill <timothy.d.h...@gmail.com> wrote:
>> Hello, all ...
>>
>> According to 
>> http://wiki.apache.org/solr/FunctionQuery/#What_is_a_Function.3F,
>> it is possible under Solr 4.0 to perform parameter substitutions
>> within function queries.
>>
>> However, I can't get the syntax provided in the documentation there to
>> work *at all* with Solr 4.0 out of the box: the only location at which
>> function queries can be specified, it seems, is in the 'fl' parameter.
>> And attempts at parameter substitutions here fail. Using (haphazardly
>> guessed) syntax like
>>
>> select?q=*:*&fl=*, test_id:if(exists(employee), employee_id,
>> socialsecurity_id), boost_id:sum($test_id, 10)&wt=xml
>>
>> results in the following error
>>
>> Error parsing fieldname: Missing param test_id while parsing function
>> 'sum($test_id, 10)'
>
> test_id needs to be an actual request parameter.
>
> This worked for me on the example data:
> http://localhost:8983/solr/query?q=*:*&fl=*,%20test_id:if(exists(price),id,name),%20boost_id:sum($param,10)&param=price
>
> -Yonik
> http://lucidimagination.com

Reply via email to