Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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. More on this later.

  • number_found: This is the total number of matching documents. This value is an estimate if the number of matching documents is more the number_found_accuracy. More on that later.

There's a keyword argument to the search.QueryOptions...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images