搜索应用

class elasticsearch.client.SearchApplicationClient

To use this client, access client.search_application from an Elasticsearch client. For example:

from elasticsearch import Elasticsearch

# Create the client instance
client = Elasticsearch(...)
# Use the search_application client
client.search_application.<method>(...)
delete(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

删除搜索应用程序。

移除搜索应用程序及其关联别名。附加到搜索应用程序的索引不会被删除。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete

Parameters:
  • name (str) – 要删除的搜索应用程序名称

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete_behavioral_analytics(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

删除行为分析集合。 关联的数据流也会被删除。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics

Parameters:
  • name (str) – 要删除的分析集合名称

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

获取搜索应用程序详情。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get

Parameters:
  • name (str) – 搜索应用程序名称

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_behavioral_analytics(*, name=None, error_trace=None, filter_path=None, human=None, pretty=None)

获取行为分析集合。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics

Parameters:
  • name (Sequence[str] | None) – 用于限制返回信息的分析集合列表

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

list(*, error_trace=None, filter_path=None, from_=None, human=None, pretty=None, q=None, size=None)

获取搜索应用程序。 获取有关搜索应用程序的信息。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics

Parameters:
  • from – 起始偏移量。

  • q (str | None) – Lucene查询字符串语法中的查询。

  • size (int | None) – 指定获取结果的最大数量。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • from_ (int | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

post_behavioral_analytics_event(*, collection_name, event_type, payload=None, body=None, debug=None, error_trace=None, filter_path=None, human=None, pretty=None)

创建行为分析收集事件。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-post-behavioral-analytics-event

Parameters:
  • collection_name (str) – 行为分析集合的名称。

  • event_type (str | Literal['page_view', 'search', 'search_click']) – 分析事件类型。

  • payload (Any | None)

  • debug (bool | None) – 响应类型是否需包含更多详细信息

  • body (Any | None)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

put(*, name, search_application=None, body=None, create=None, error_trace=None, filter_path=None, human=None, pretty=None)

创建或更新搜索应用程序。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put

Parameters:
  • name (str) – 待创建或更新的搜索应用程序名称。

  • search_application (Mapping[str, Any] | None)

  • create (bool | None) – 若为 true,则此请求不能替换或更新现有搜索应用程序。

  • body (Mapping[str, Any] | None)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

put_behavioral_analytics(*, name, error_trace=None, filter_path=None, human=None, pretty=None)

创建行为分析集合。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics

Parameters:
  • name (str) – 待创建或更新的分析集合名称。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

render_query(*, name, error_trace=None, filter_path=None, human=None, params=None, pretty=None, body=None)

渲染搜索应用程序查询。 使用指定的查询参数和与搜索应用程序关联的搜索模板(若未指定则使用默认模板)生成Elasticsearch查询。 若搜索模板中使用的参数未在params中指定,则将使用该参数的默认值。 此API返回通过调用搜索应用程序搜索API将生成并运行的具体Elasticsearch查询。

您必须对搜索应用程序的后备别名具有read权限。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-render-query

Parameters:
Return type:

ObjectApiResponse[Any]

search(*, name, error_trace=None, filter_path=None, human=None, params=None, pretty=None, typed_keys=None, body=None)

执行搜索应用程序搜索。 生成并运行一个Elasticsearch查询,该查询使用指定的查询参数和与搜索应用程序关联的搜索模板或默认模板。 未指定的模板参数将根据情况分配其默认值。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-search

Parameters:
  • name (str) – 待搜索的搜索应用程序名称。

  • params (Mapping[str, Any] | None) – 此请求特有的查询参数,将覆盖模板中指定的任何默认值。

  • typed_keys (bool | None) – 决定响应中聚合名称是否以其各自类型为前缀。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]