API создания фильтров
Создаёт фильтр.
Запрос
PUT _ml/filters/<filter_id>
Предварительные требования
Требуется привилегия кластера manage_ml. Эта привилегия включена в встроенную роль machine_learning_admin.
Описание
Фильтр содержит список строк. Он может использоваться одним или несколькими заданиями. В частности, фильтры упоминаются в свойстве custom_rules объектов конфигурации детекторов. Для получения дополнительной информации см. Пользовательские правила.
Параметры пути
-
<filter_id> - (Обязательно, строка) Строка, которая однозначно идентифицирует фильтр.
Тело запроса
-
description - (Необязательно, строка) Описание фильтра.
-
items - (Обязательно, массив строк) Элементы фильтра. Дикий символ
*может использоваться в начале или конце элемента. В каждом фильтре разрешено до 10000 элементов.
Примеры
resp = client.ml.put_filter(
filter_id="safe_domains",
description="A list of safe domains",
items=[
"*.google.com",
"wikipedia.org"
],
)
print(resp) response = client.ml.put_filter(
filter_id: 'safe_domains',
body: {
description: 'A list of safe domains',
items: [
'*.google.com',
'wikipedia.org'
]
}
)
puts response const response = await client.ml.putFilter({
filter_id: "safe_domains",
description: "A list of safe domains",
items: ["*.google.com", "wikipedia.org"],
});
console.log(response); PUT _ml/filters/safe_domains
{
"description": "A list of safe domains",
"items": ["*.google.com", "wikipedia.org"]
} При создании фильтра вы получите следующий ответ:
{
"filter_id": "safe_domains",
"description": "A list of safe domains",
"items": ["*.google.com", "wikipedia.org"]
}
© 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-put-filter.html