获取 enrich 策略 API
编辑获取 enrich 策略 API编辑
返回有关 enrich 策略 的信息。
response = client.enrich.get_policy( name: 'my-policy' ) puts response
GET /_enrich/policy/my-policy
路径参数编辑
-
<name>
-
(可选,字符串)用于限制请求的 enrich 策略名称的逗号分隔列表。
要返回所有 enrich 策略的信息,请省略此参数。
示例编辑
获取单个策略编辑
response = client.enrich.get_policy( name: 'my-policy' ) puts response
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" ] } } } ] }
获取多个策略编辑
response = client.enrich.get_policy( name: 'my-policy,other-policy' ) puts response
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" ] } } } ] }
获取所有策略编辑
response = client.enrich.get_policy puts response
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" ] } } } ] }