【问题标题】:GAE Full text search data is cleared on dev server restartGAE全文搜索数据在开发服务器重新启动时被清除
【发布时间】:2015-02-27 11:48:30
【问题描述】:

我正在使用 GAE 本地服务器进行开发。我存储在数据存储以及全文搜索中以进行一些特定的搜索。当我重新启动本地开发服务器时,数据存储中的数据将保留在全文搜索索引被清除的位置。这导致我的应用程序中的数据不一致。全文搜索是否可以保留索引数据?

【问题讨论】:

标签: google-app-engine google-search-api


【解决方案1】:

类似的想法发生在我身上(仅限本地服务器),看起来“put_async”对我不起作用:

search.Index(name='myindex').put_async(search.Document(...))

当我使用“放置”时,文件被存储了:

id = search.Index(name='myindex').put(search.Document(...))

我遇到的第二个问题是,我从 eclipse 运行 appengine,当您在 eclipse 中终止 app engine 时,它​​不会保存 search_indexes 文件!为了克服这个问题,我发现您可以使用 pydev 调试器运行应用程序引擎,它将在控制台中输出进程 pid(使用第一个),然后您可以发送

kill -SIGINT [来自控制台的 pid]

类似于 ctrl-c。 appengine 服务器将处理信号并保存 search_indexes。

开始时的输出如下所示:

pydev debugger: starting (pid: 7643)
INFO     2015-12-10 06:02:42,308 sdk_update_checker.py:229] Checking for updates to the SDK.
INFO     2015-12-10 06:02:42,527 sdk_update_checker.py:257] The SDK is up to date.
INFO     2015-12-10 06:02:42,852 api_server.py:205] Starting API server at: http://localhost:45081
INFO     2015-12-10 06:02:43,037 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-12-10 06:02:43,041 admin_server.py:116] Starting admin server at: http://localhost:8000
pydev debugger: starting (pid: 7664)
INFO     2015-12-10 06:02:50,740 module.py:787] default: "GET /_ah/warmup HTTP/1.1" 404 27

发送 kill -SIGINT 7643 后

INFO     2015-12-10 06:21:19,494 shutdown.py:45] Shutting down..
INFO     2015-12-10 06:21:19,546 api_server.py:648] Applying all pending transactions and saving the datastore
INFO     2015-12-10 06:21:19,561 api_server.py:651] Saving search indexes

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-20
    • 1970-01-01
    • 2010-10-27
    相关资源
    最近更新 更多