函数

注意:**我们不再建议采用这种解决方案。**使用此 API 的应用只能在 Python 2 运行时环境中运行,并且必须先升级到[建议的解决方案] (/appengine/docs/standard/python/migrate-to-python3/migrating-services#migration_paths_for_bundled_services),然后才能迁移到 Python 3 运行时。

google.appengine.api.search 包包含以下函数:

get_indexes(namespace='', offset=None, limit=None, start_index_name=None, include_start_index=True, index_name_prefix=None, fetch_schema=False, deadline=None)

返回可用索引列表。

参数

namespace

要返回的索引的命名空间。如果未设置,则使用当前命名空间。

offset

要返回的第一个索引的偏移。

limit

要返回的索引数。

start_index_name

要返回的第一个索引的名称。

include_start_index

如果为 true,则在结果中包含 start_index_name 指定的索引。

index_name_prefix

用于选择要返回的索引的前缀。

fetch_schema

指定是否为每个索引获取架构。

deadline

远程过程调用 (RPC) 的期限(以秒为单位)。

结果值

表示索引列表的 GetResponse 对象。如果 fetch_schema==true,则每个索引都将包含其架构。

异常

TypeError

传递的参数无效。

InternalError

请求在内部服务器上失败。