Python 应用程序引擎搜索API-暂时性错误

Python 应用程序引擎搜索API-暂时性错误,python,google-app-engine,Python,Google App Engine,应用程序引擎全文搜索API抛出TransientError时出现问题。这是我可能制作的最简单的表单(它仍然会在生产服务器上给出错误,但不会在开发人员上给出)。请注意,这发生在我所有的5个搜索索引上,而不仅仅是这一个 from google.appengine.api import search query_obj = search.Query(query_string='') print search.Index(name='donation').search(query=query_obj)

应用程序引擎全文搜索API抛出
TransientError
时出现问题。这是我可能制作的最简单的表单(它仍然会在生产服务器上给出错误,但不会在开发人员上给出)。请注意,这发生在我所有的5个搜索索引上,而不仅仅是这一个

from google.appengine.api import search

query_obj = search.Query(query_string='')
print search.Index(name='donation').search(query=query_obj)
以下是App Engine给出的错误:

File "/base/data/home/apps/s~ghidonations/4e.365801633107307526/GlobalUtilities.py", line 914, in search
  search_results = search.Index(name=index_name).search(query=query_obj)
File "/python27_runtime/python27_lib/versions/1/google/appengine/api/search/search.py", line 3093, in search
  raise _ToSearchError(e)
TransientError
在我写这篇文章的时候,一些搜索查询实际上又开始工作了(5分钟前抛出了错误),但有些仍然很愚蠢。我在以前的论坛上读到过关于按日期排序的内容(我在实际的生产代码中是这样做的),所以我想把它去掉可以解决这个问题。它没有看到上面的3行代码


你知道是什么原因造成的吗?

传输错误是将来会消失的错误。我不知道是什么原因导致这些错误,bug google建议只需重试搜索

# Index the document.
try:
    index.put(doc)
except search.PutError, e:
    result = e.results[0]
    if result.code == search.OperationResult.TRANSIENT_ERROR:
        # possibly retry indexing result.object_id
except search.Error, e:
    # possibly log the failure
这个例子来自Index.put文档,但这是我能找到的搜索api中唯一一个暂时性错误的例子,所以我希望您可以使用相同的技术

来源