Google App EngineSearch API中的分页 [英] Pagination in Google App EngineSearch API

查看:89
本文介绍了Google App EngineSearch API中的分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用游标在Google应用程序引擎搜索API中进行分页(不偏移)。前向分页很简单,问题是如何实现后向分页。

I want to do pagination in google app engine search api using cursors (not offset). the forward pagination is straight forward , the problem is how to implement the backward pagination.

推荐答案

我猜你运气不好当涉及到使用游标向后分页时。

I guess you're out of luck when it comes to paging backwards using cursors.


Search API还支持使用查询游标。游标是指示查询开始点的另一种方式,允许您从前一个结果集的末尾继续搜索。使用光标通常比使用偏移更有效。 但是,Search API目前不支持反向游标,因为数据存储区API也是如此,这使得实现向后分页变得更加困难。因此,示例应用程序使用偏移量而不是游标对其查询结果进行分页。您可以在此处找到使用游标的示例。

The Search API also supports the use of query cursors. Cursors are another way to indicate the point from which to begin a query, allowing you to continue a search from the end of the previous result set. Using a cursor is generally more efficient than using offsets. However, the Search API doesn't currently support a "reverse cursor" as does the Datastore API, making it more difficult to to implement backward paging. For this reason, the example application uses offsets rather than cursors to paginate its query results. You can find an example using cursors here.

来源

这篇关于Google App EngineSearch API中的分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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