Solr cursor marker and pagination

元气小坏坏 提交于 2019-12-08 21:07:40

The cursorMark tells Solr where it should start the next response. It's analogous to the start parameter in your first example. As you're paginating through the results, each response's cursorMark shows where the next page starts.

If you're just looking for "what is the first result on page 1001", first version will work just fine. If you're paginating through the results - were a user may or may not go to the next page, the point about using cursorMarks is that each node (or in a single node setup) know which document was the last one to be shown, and thus, can return only rows number of documents from the current position for each node. If you'd do the first version, each node would have to return start + rows documents. So instead of trying to find out "which documents are the ten ones after 20001", you just need to answer "which documents are the next ten after this sort key".

In addition cursorMarks handles updates to the result set better, as you avoid any changes to the result set that would push documents that have already been shown back into the next page you're displaying.

See the reference guide for complete examples and further descriptions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!