Solr: Use Cursor in pagination to get previous page

依然范特西╮ 提交于 2019-12-12 04:37:16

问题


I am new to solr and trying to implement the pagination feature on my search page. Initially I was using the basic pagination method mentioned here: https://cwiki.apache.org/confluence/display/solr/Pagination+of+Results

So moving to next and previous pages both were fine as I can just change the index over there. But how do I go to the previous page using cusrsorMark as solr only returns the nextCursorMark.


回答1:


You'll have to keep the previous cursorMark available client side - meaning that it has to be a part of the URL request going forward, so you're able to move back to the previous cursorMarks (for example through a previousMark=foobar URL argument) if necessary.

Keeping a previousCursorMark available on the Solr side would require fetching at least twice as many documents from each server, so I guess that's the reason why only the nextCursorMark is included (since you can cache the previous cursor marks yourself if you need that functionality).



来源:https://stackoverflow.com/questions/40735081/solr-use-cursor-in-pagination-to-get-previous-page

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