O'Reilly logo

Mastering Google App Engine by Mohsin Shafique Hijazee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Pagination

The last piece of the puzzle is pagination. So let's look into that. By default when you issue an index.search() call, the first 20 matching documents are returned and the result is actually a search.SearchResult instance, which has the following properties:

  • results: This are the list of ScoreDocument instances. Each object in this list has fields property that we already have seen. The number of items by default are 20 but you can increase that number by supplying a limit keyword argument to search.QueryOptions.
  • cursor: This is a pointer to the last document in the results list above. So the next time you execute index.search() with the same query and pass this as cursor keyword argument, the read operation will start from that point. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required