The above code will give you the first batch of doc_ids with which I had to spend hours to find this. Use the following code to get all doc_ids ...
from google.appengine.api import search
index = search.Index('YOUR_INDEX_NAME')
document_ids = [document.doc_id for document in index.get_range(start_id="0", ids_only=True)]
while len(document_ids)>1:
for doc_id in document_ids:
print doc_id
document_ids = [document.doc_id for document in index.get_range(start_id=doc_id, ids_only=True)]
source
share