Google AppEngine Search Ranking

83 Views Asked by At

When I do a GAE search with limit=20, I am not getting the 20 highest-ranked results, and I am not sure if this is a bug or a known-limitation (feature).


Here are my top search results with limit=20 (where first number is the rank, second number is just a related-timestamp to make things easier to read):

rank 1589728448 2017-09-03 12:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589780648 2017-09-02 21:30:00
rank 1589786048 2017-09-02 20:00:00
rank 1589786048 2017-09-02 20:00:00
rank 1589804048 2017-09-02 15:00:00
rank 1589807648 2017-09-02 14:00:00
rank 1589807648 2017-09-02 14:00:00
rank 1589814848 2017-09-02 12:00:00
rank 1589814848 2017-09-02 12:00:00
rank 1589865248 2017-09-01 22:00:00
rank 1589870648 2017-09-01 20:30:00
rank 1589876048 2017-09-01 19:00:00
rank 1589879648 2017-09-01 18:00:00
rank 1590416048 2017-08-26 13:00:00
rank 1593852248 2017-07-17 18:30:00
rank 1594282448 2017-07-12 19:00:00
rank 1595326448 2017-06-30 17:00:00

And likewise, here are the best-ranking documents from a search with limit=1000:

rank 1589721248 2017-09-03 14:00:00
rank 1589728448 2017-09-03 12:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589778848 2017-09-02 22:00:00
rank 1589780648 2017-09-02 21:30:00
rank 1589782448 2017-09-02 21:00:00
rank 1589786048 2017-09-02 20:00:00
rank 1589786048 2017-09-02 20:00:00
rank 1589804048 2017-09-02 15:00:00
rank 1589807648 2017-09-02 14:00:00
rank 1589807648 2017-09-02 14:00:00
rank 1589814848 2017-09-02 12:00:00
rank 1589814848 2017-09-02 12:00:00
rank 1589865248 2017-09-01 22:00:00
rank 1589870648 2017-09-01 20:30:00
rank 1589876048 2017-09-01 19:00:00
rank 1589876048 2017-09-01 19:00:00
rank 1589879648 2017-09-01 18:00:00
rank 1589890448 2017-09-01 15:00:00
rank 1590131648 2017-08-29 20:00:00
rank 1590304448 2017-08-27 20:00:00
rank 1590416048 2017-08-26 13:00:00
rank 1590419648 2017-08-26 12:00:00
rank 1593852248 2017-07-17 18:30:00
rank 1594037648 2017-07-15 15:00:00
rank 1594282448 2017-07-12 19:00:00
rank 1595326448 2017-06-30 17:00:00

Notice that there is definitely some overlap...but that limit=1000 returns higher-ranking documents that limit=20 omitted. Almost like limit=20 gave up before it found all the best documents.

Am I doing something wrong, or should I not expect limit=N to return the N-best results?


The Google Appengine Search docs state:

The rank of a document is a positive integer which determines the default ordering of documents returned from a search.

As well as the following about cursors and limits:

A call to search() can only return a limited number of matching documents. You can repeat the same search, using cursors or offsets to retrieve the complete set of matching documents.

Support paging through the search results by returning only a portion of the matched documents on each query (using offsets and cursors)

I am unclear how paging across results would work here, given that the first page of results (with limit=20) isn't actually guaranteed to be the first 20 results... :/

0

There are 0 best solutions below