Skip to content

Instantly share code, notes, and snippets.

@filleokus
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filleokus/8941f0824bef0fd921a7 to your computer and use it in GitHub Desktop.
Save filleokus/8941f0824bef0fd921a7 to your computer and use it in GitHub Desktop.
def get_all():
doc_index = search.Index(API_ITEMS_INDEX_NAME)
firstBatch = doc_index.get_range(start_id=None, limit=1000).results
results = firstBatch
while True:
batch = doc_index.get_range(results[-1].doc_id,1000)
if len(batch.results) == 1:
break
else:
results = results + batch.results
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment