PUT _ilm/policy/rtc_logs_policy
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_age": "1d"
},
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "15d",
"actions": {
"delete": {}
}
}
}
}
}
PUT /_template/rtcmedia_template
{
"order": 0,
"index_patterns": "rtcmedia-*",
"settings": {
"index" : {
"lifecycle" : {
"name" : "rtc_logs_policy",
"rollover_alias" : "rtcmedia"
}
},
"default_pipeline": "world_countries_v7_lookup"
},
"mappings": {
"dynamic": true,
"properties": {
"user_loc": {
"type": "geo_point"
},
"time": {
"type": "date"
}
},
"_source": {
"excludes": [
"geo_country.coordinates"
]
}
}
}
PUT /%3Crtcmedia-%7Bnow%2Fs%7Byyyy-MM-dd%7D%7D-000001%3E
{
"aliases": {
"rtcmedia": {
"is_write_index": true
}
}
}
PUT /_enrich/policy/world_countries_v7
{
"geo_match": {
"indices": "world_countries_v7",
"match_field": "coordinates",
"enrich_fields": ["name"]
}
}
POST /_enrich/policy/world_countries_v7/_execute
PUT /_ingest/pipeline/world_countries_v7_lookup
{
"description": "Enrich postal codes",
"processors": [
{
"enrich": {
"policy_name": "world_countries_v7",
"field": "user_loc",
"target_field": "geo_country",
"shape_relation": "INTERSECTS",
"max_matches": "1"
}
},
{
"remove": {
"field": "geo_country.coordinates"
}
}
]
}
GET /_ingest/pipeline/world_countries_v7_lookup
POST rtcmedia-2021-06-03-000007/_search
{
"size":2
}
POST rtcmedia-2021-06-03-000007/_search
{
"size":2,
"query": {
"bool": {
"must": [
{
"exists": {
"field": "geo_country"
}
}
]
}
}
}
PUT rtcmedia-2021-06-03-000007/_settings
{
"settings": {
"default_pipeline": "world_countries_v7_lookup"
}
}
POST /rtcmedia-2021-06-03-000007/_update_by_query
{
"script": "ctx._source.remove('geo_country')",
"query": {
"bool": {
"must": [
{
"exists": {
"field": "geo_country"
}
}
]
}
}
}
POST /rtcmedia-2021-06-03-000007/_cache/clear
POST /rtcmedia-2021-06-03-000007/_forcemerge?only_expunge_deletes=true&max_num_segments=1
{}