es pipeline


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
{}
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值