You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2015/01/20 18:47:35 UTC
[jira] [Commented] (SOLR-6635) Cursormark should support
skipping/goto functionality
[ https://issues.apache.org/jira/browse/SOLR-6635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14284098#comment-14284098 ]
Hoss Man commented on SOLR-6635:
--------------------------------
this should be fairly straight forward, all of the Plubming is there in the Searcher methods to take in both a start offset & sortField array (what gets serialized by the cursork mark) currently the solr code just prevents you from doing this because the semantics of what it should mean and how it should work weren't well defined from a user perspective (and of course: not test to prove those semantics were correct)
what would probably make the most sense would be:
1) start & cursorMark can be combined and if both are specified are propogated down to the appropriate methods.
2) when start > 0 & cursorMark=*, it is functionally equivilent to no cursorMark being specified at all (ie: regular pagination) _except_ that the use of the cursorMark param indicates to Solr that the client wnats the nextCursorMark to be computed.
this _should_ make the most obvious usecase fairly trivial:
1) user does normal search with start=0&rows=X
2) user goes to page#2 using start=X&rows=X
3) user keeps iterating for a few pages increasing start each time
4) at some threshold (start=N), client decides that if user wants to keep going, they are goin to stop using regular pagination and switch to cursor, so they specify start=N&rows=X&cursorMark=*
5) this gets them the same logical "next" page of results, based on a cursor starting at the begining of the result set, and the "start" offset - the nextCursorMark returned is also correct for the end of the current page.
6) from this point on, the client switches to sending start=0, and only modifying the cursorMark on each request.
it also supports the less likely, but still somewhat interesting usecase of using cursorts to iterate, but then wanting to "peek" ahead of the current cursor by incrementing start (and ignorning the nextCursorMark returned)
---
the real devil in the details of this change will be in ensuring that the existing logic for knowing when it's neccessary to avoid the queryResultCache because of the start vs cursorMark usage is still correct once both are allowed.
> Cursormark should support skipping/goto functionality
> -----------------------------------------------------
>
> Key: SOLR-6635
> URL: https://issues.apache.org/jira/browse/SOLR-6635
> Project: Solr
> Issue Type: Improvement
> Components: SearchComponents - other
> Reporter: Thomas Blitz
> Labels: cursormark, pagination, search, solr
>
> Deep pagination is possible with the cursormark.
> We have discovered a need to be able to 'skip' a number of results.
> Using the cursormark it should be possible to define a request with a skip parameter, allowing the cursormark to simple skip a number of articles, kinda like a goto, and then return results from that point in the resultset.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org