2020-10-12 r囧r小猫 2022-12-13 14:29 101阅读 0赞 # Kibana常用操作(包括增删改查) # ### 一.操作索引 ### 1.查询elasticsearch中所有索引 GET \_cat/indices 2.删除索引 DELETE 索引名 3.创建索引 PUT 索引名 ### 二.操作一条数据 ### 1.插入一条数据。如果是插入复杂结构的数据,比如有嵌套,有json数据,那么在插入数据之前,最好先新建mapping,要不然可能会报错 POST test\_index/test\_type/\_mapping \{ "test\_type": \{ "dynamic": false, "\_all": \{ "enabled": false \}, "properties": \{ "wbbh": \{ "type": "keyword" \}, "jyxkzbh": \{ "type": "keyword" \}, "wbmc": \{ "type": "text", "analyzer": "smartcn", "fields": \{ "raw": \{ "type": "keyword" \}, "standard": \{ "type": "text", "analyzer": "standard" \} \} \}, "zbx": \{ "type": "keyword" \}, "zby": \{ "type": "keyword" \}, "zby\_zbx": \{ "type": "keyword" \}, "lksj": \{ "type": "keyword" \}, "wbdz": \{ "type": "text", "analyzer": "smartcn", "fields": \{ "raw": \{ "type": "keyword" \}, "standard": \{ "type": "text", "analyzer": "standard" \} \} \}, "cjsj": \{ "type": "date" \}, "rksj": \{ "type": "date" \}, "gxdwmc": \{ "type": "text", "analyzer": "smartcn", "fields": \{ "raw": \{ "type": "keyword" \}, "standard": \{ "type": "text", "analyzer": "standard" \} \} \}, "wbfzr": \{ "type": "text", "analyzer": "smartcn", "fields": \{ "raw": \{ "type": "keyword" \}, "standard": \{ "type": "text", "analyzer": "standard" \} \} \}, "dt": \{ "type": "keyword" \}, "type": \{ "type": "keyword" \} \} \} \} 2.插入数据 PUT test\_index/test\_type/test\_id \{ "title": "python分布式爬虫开发", "salary\_min": 15000, "city": "北京", "company": \{ "name": "百度", "company\_addr": "北京市软件园" \}, "publish\_date": "2017-4-16", "comments": 15 \} ### 三.操作模板 ### 1.新建模板 POST \_scripts / 模板ID \{ "script": \{ "lang": "mustache", "source": \{ "query": \{ "match": \{ "order\_id": "\{ \{orderId\}\}" \} \} \} \} \} 2.查看模板语句 GET \_scripts/模板ID 3.使用模板语句进行查询 GET 索引名/\_search/template \{ "id": "模板ID", "params": \{ "orderId": "570111" \} \}
相关 算法 - Leetcode - 练习题目 - 记录 - 20201012 1.应用场景 <table> <tbody> <tr> <td>主要用于记录个人leetcode解题过程。</td> </tr> </tbody> 待我称王封你为后i/ 2022年12月14日 03:41/ 0 赞/ 176 阅读
还没有评论,来说两句吧...