如何将文档列表异步添加到Appengine搜索API索引?

2024-04-28 05:50:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在试验Appengine(python)SearchAPI。我已经创建了一个文档列表,并且正在将此文档列表正确地添加到搜索API索引中。它工作得很好,但我的代码必须等待(同步地)发生这种情况。你知道吗

我的业务逻辑允许异步进行,我想知道是否有人对我如何同步添加它有一些建议(类似于其他一些appengine python技巧,如put\u async)。你知道吗

代码:

try:        
    search.Index(name=free_text_index).add(documents)
except search.Error:
    logging.exception("Add to Free Text Index " + free_text_index + " failed")

寻找一些东西来允许这样的东西(或者对一些有同样效果的东西的建议)。你知道吗

我正在寻找类似于put\u async命令的东西。你知道吗

myobject.put_async()

提前谢谢!你知道吗


Tags: 代码text文档apifree列表searchasync