[ 
https://issues.apache.org/jira/browse/SOLR-1297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916746#action_12916746
 ] 

Hoss Man commented on SOLR-1297:
--------------------------------

In dependent of my previous patch, there is one other nuance i discoverd today 
that i wanted to bring up...

The way localparams are currently supported in the sort param, they are 
independent for each "segment" of the sort.  The easiest way to make sense of 
this is to look at the following contrived example URL (you can try it against 
the example data on trunk) ...

{noformat}
?q=*:*&fl=price,id&foo=0&sort={!foo=2}sum($foo,0)+asc,+mul($foo,price)+desc,+id+asc
{noformat}

...that URL (currently) results in a sort which is equivalent to "id asc" .. 
the localParam value of "foo=2" at the begining of the sort param is only in 
scope for the first segment...

{noformat}
{!foo=2}sum($foo,0) asc
{noformat}

..the second segment of the sort param winds up getting the "global" value of 
"foo=0" ...

{noformat}
mul($foo,price) desc
{noformat}

...so it becomes a NOOP (multiplication by zero)

This limited scoping of localParams in the sort param seems counter intuitive 
to me.  I don't know that i have a better suggestion for how it *should* work, 
but i wanted to draw attention to it in case other folks had any ideas

> Enable sorting by Function Query
> --------------------------------
>
>                 Key: SOLR-1297
>                 URL: https://issues.apache.org/jira/browse/SOLR-1297
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 1.5, 3.1, 4.0
>
>         Attachments: SOLR-1297-2.patch, SOLR-1297.better.field.support.patch, 
> SOLR-1297.patch, SOLR-1297.patch, SOLR-1297.patch
>
>
> It would be nice if one could sort by FunctionQuery.  See also SOLR-773, 
> where this was first mentioned by Yonik as part of the generic solution to 
> geo-search

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to