API получения политики обогащения
Возвращает информацию об политике обогащения.
GET /_enrich/policy/my-policy
Запрос
GET /_enrich/policy/<name>
GET /_enrich/policy
GET /_enrich/policy/policy1,policy2
Предварительные условия
Если вы используете функции безопасности Elasticsearch, у вас должны быть:
-
readправа на индекс для всех используемых индексов -
enrich_userвстроенная роль
Параметры пути
-
<name> -
(Необязательно, строка) Список политик обогащения, разделенных запятыми, используемых для ограничения запроса.
Для возвращения информации обо всех политиках обогащения опустите этот параметр.
Примеры
Получение одной политики
GET /_enrich/policy/my-policy
API возвращает следующий ответ:
{
"policies": [
{
"config": {
"match": {
"name": "my-policy",
"indices": [ "users" ],
"match_field": "email",
"enrich_fields": [
"first_name",
"last_name",
"city",
"zip",
"state"
]
}
}
}
]
} Получение нескольких политик
GET /_enrich/policy/my-policy,other-policy
API возвращает следующий ответ:
{
"policies": [
{
"config": {
"match": {
"name": "my-policy",
"indices": [ "users" ],
"match_field": "email",
"enrich_fields": [
"first_name",
"last_name",
"city",
"zip",
"state"
]
}
}
},
{
"config": {
"match": {
"name": "other-policy",
"indices": [ "users" ],
"match_field": "email",
"enrich_fields": [
"first_name",
"last_name",
"city",
"zip",
"state"
]
}
}
}
]
} Получение всех политик
GET /_enrich/policy
API возвращает следующий ответ:
{
"policies": [
{
"config": {
"match": {
"name": "my-policy",
"indices": [ "users" ],
"match_field": "email",
"enrich_fields": [
"first_name",
"last_name",
"city",
"zip",
"state"
]
}
}
},
{
"config": {
"match": {
"name": "other-policy",
"indices": [ "users" ],
"match_field": "email",
"enrich_fields": [
"first_name",
"last_name",
"city",
"zip",
"state"
]
}
}
}
]
}
© 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/7.17/get-enrich-policy-api.html