API обновления фильтров
Обновляет описание фильтра, добавляет или удаляет элементы.
Запрос
POST _ml/filters/<filter_id>/_update
Предварительные условия
Требует привилегию кластера manage_ml. Эта привилегия включена в встроенную роль machine_learning_admin.
Параметры пути
-
<filter_id> - (Обязательно, строка) Строка, которая однозначно идентифицирует фильтр.
Тело запроса
-
add_items - (Необязательно, массив строк) Элементы, которые нужно добавить в фильтр.
-
description - (Необязательно, строка) Описание фильтра.
-
remove_items - (Необязательно, массив строк) Элементы, которые нужно удалить из фильтра.
Примеры
resp = client.ml.update_filter(
filter_id="safe_domains",
description="Updated list of domains",
add_items=[
"*.myorg.com"
],
remove_items=[
"wikipedia.org"
],
)
print(resp) response = client.ml.update_filter(
filter_id: 'safe_domains',
body: {
description: 'Updated list of domains',
add_items: [
'*.myorg.com'
],
remove_items: [
'wikipedia.org'
]
}
)
puts response const response = await client.ml.updateFilter({
filter_id: "safe_domains",
description: "Updated list of domains",
add_items: ["*.myorg.com"],
remove_items: ["wikipedia.org"],
});
console.log(response); POST _ml/filters/safe_domains/_update
{
"description": "Updated list of domains",
"add_items": ["*.myorg.com"],
"remove_items": ["wikipedia.org"]
} API возвращает следующие результаты:
{
"filter_id": "safe_domains",
"description": "Updated list of domains",
"items": ["*.google.com", "*.myorg.com"]
}
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-filter.html