原英文版地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-update-filter.html, 原文档版权归 www.elastic.co 所有
本地英文版地址: ../en/ml-update-filter.html

Update filter APIedit

Updates the description of a filter, adds items, or removes items.

Requestedit

POST _ml/filters/<filter_id>/_update

Prerequisitesedit

  • If the Elasticsearch security features are enabled, you must have manage_ml or manage cluster privileges to use this API. See Security privileges.

Path parametersedit

<filter_id>
(Required, string) A string that uniquely identifies a filter.

Request bodyedit

add_items
(Optional, array of strings) The items to add to the filter.
description
(Optional, string) A description for the filter.
remove_items
(Optional, array of strings) The items to remove from the filter.

Examplesedit

POST _ml/filters/safe_domains/_update
{
  "description": "Updated list of domains",
  "add_items": ["*.myorg.com"],
  "remove_items": ["wikipedia.org"]
}

The API returns the following results:

{
  "filter_id": "safe_domains",
  "description": "Updated list of domains",
  "items": ["*.google.com", "*.myorg.com"]
}