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

Ramana edited comment on SOLR-6121 at 7/29/14 5:46 AM:
-------------------------------------------------------

Attached is the patch for the changes.
Now, cursorMark accepts sort param without explicit unique key. 
When user querying something like 
http://localhost:8983/solr/collection1/select?q=*hd*&sort=price+desc&rows=5&cursorMark=*
 
under the hood we are adding the unique key field to the sort. In this example 
it is "id desc".

In the QueryParsing class, while preparing the sort specification for the 
query, Now we are verifying if the "cursorMark" is there in the URL, If exists, 
we are identifying the unique key and adding to sort. With these changes we 
will not get the error "Cursor functionality requires a sort containing a 
uniqueKey field tie breaker"  error.



was (Author: ramanaopensource):
Attached is the patch for the changes.
Now, cursorMark accepts sort param without explicit unique key. 
When user querying something like 
http://localhost:8983/solr/collection1/select?q=*hd*&sort=price+desc&rows=5&cursorMark=*
 
under the hood we are adding the unique key field to the sort. In this example 
it is "id desc".

In the QueryComponent, while preparing the sort specification for the query, 
Now we are verifying if the "cursorMark" is there in the URL, If exists, we are 
identifying the unique key and adding to sort. With these changes we will not 
get the error "Cursor functionality requires a sort containing a uniqueKey 
field tie breaker"  error.


> cursorMark should accept sort param without explicit uniqueKey, do implicit 
> uniqueKey tie breaker sort under the hood
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-6121
>                 URL: https://issues.apache.org/jira/browse/SOLR-6121
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: SOLR-6121.patch
>
>
> If you are using the cursorMark (deep paging) feature, you shouldn't *have* 
> to add the uniqueKey to the sort parameter.  If the user doesn't do it, the 
> user obviously doesn't care about the uniqueKey order relative to whatever 
> other sort parameters they may or may not have provided.  So if sort doesn't 
> have it, then Solr should simply tack it on at the end instead of providing 
> an error and potentially confusing the user.  This would be more user 
> friendly.
> Quoting Hoss from 
> [SOLR-5463|https://issues.apache.org/jira/browse/SOLR-5463?focusedCommentId=14011384&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14011384]:
> {quote}
> The reason the code currently throws an error was because i figured it was 
> better to force the user to choose which tie breaker they wanted (asc vs 
> desc) then to just magically pick one arbitrarily.
> If folks think a magic default is a better i've got no serious objections – 
> just open a new issue.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to