lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <yo...@lucidimagination.com>
Subject Re: sort by function problem
Date Wed, 06 Apr 2011 13:36:16 GMT
The problem is "query(mothers day)"
See http://wiki.apache.org/solr/FunctionQuery#query

You can't directly include query syntax because the function parser
wouldn't know how to get to the end of that syntax.
You could either do
   "query($qq)"  and then add a "qq=mothers day" to the request
Or if you really wanted the whole thing inline, you could do
   "query({!v='mothers day'})

But the first form is nicer since you don't have to worry about
escaping at all, and I think it's also more readable.

-Yonik
http://www.lucenerevolution.org -- Lucene/Solr User Conference, May
25-26, San Francisco


On Wed, Apr 6, 2011 at 6:48 AM, ramzesua <michaelnazaruk@gmail.com> wrote:
> I try to use sort by function in a new release of SOLR 3.1, but I have some
> problems, for example:
> http://localhost:8983/new_search/select?q=mothers
> day&indent=true&fl=templateSetId,score,templateSetPopularity&sort=product(templateSetPopularity,query(mothers
> day)) desc
> templateSetPopularity - my field with popularity rank
> query(mothers+day,0.0) - I try to get score value
> At result I get error:
> HTTP Status 400 - Can't determine Sort Order:
> 'sum(templateSetPopularity,query(mothers day)) desc', pos=3
> Where is my error?
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/sort-by-function-problem-tp2784493p2784493.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Mime
View raw message