Solr:在分页中使用游标获取上一页 [英] Solr: Use Cursor in pagination to get previous page

查看:183
本文介绍了Solr:在分页中使用游标获取上一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是solr的新手,正在尝试在我的搜索页面上实现分页功能.最初,我使用的是这里提到的基本分页方法: https://cwiki .apache.org/confluence/display/solr/Pagination + of + Results

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

因此,转到下一页和上一页都很好,因为我可以在那儿更改索引.但是如何使用cusrsorMark作为solr转到上一页,只会返回nextCursorMark.

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.

推荐答案

您必须保留以前的cursorMark可用的客户端-这意味着它必须是继续进行的URL请求的一部分,因此您可以如有必要,可返回到先前的cursorMarks(例如,通过previousMark=foobar URL参数).

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.

保持Solr端可用的previousCursorMark要求从每台服务器获取至少两倍多的文档,因此我想这就是为什么只包含nextCursorMark的原因(因为如果需要的话,您可以自己缓存上一个游标)功能).

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).

这篇关于Solr:在分页中使用游标获取上一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆