Kibana6.0 常用增删改查命令——script

Posted 羲凡丞相

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kibana6.0 常用增删改查命令——script相关的知识,希望对你有一定的参考价值。

@羲凡——只为了更好的活着

Kibana6.0 常用增删改查命令(四)——script

1.script样例

取address中数量大于2的条数

PUT /aaron_index

PUT /aaron_index/_mappings

  "properties":  
	"name":"type": "keyword",
    "address" : "properties" :  "id" :  "type" : "integer" , "city" :  "type" : "keyword"  
  


POST /aaron_index/_bulk
 "index":  "_id":1
 "name": "张辽","address":["id":1,"city":"雁门马邑","id":2,"city":"山西省朔州"]
 "index":  "_id": 2
 "name": "曹操","address":["id":1,"city":"沛国谯县","id":2,"city":"安徽亳州","id":3,"city":"河南许昌"]
 "index":  "_id": 8
 "name": "羲凡","address":["id":1,"city":"江苏南京"]


GET /aaron_index/_search

  "query": 
    "script": 
      "script": "doc['address.id'].size() > 2"
    
  ,
  "_source": "address.city"

====================================================================

@羲凡——只为了更好的活着

若对博客中有任何问题,欢迎留言交流

以上是关于Kibana6.0 常用增删改查命令——script的主要内容,如果未能解决你的问题,请参考以下文章

Kibana6.0 常用增删改查命令——script

增删改查sql语句

MySQL数据库增删改查等常用命令介绍

增删改查sql语句

sqlite常用的命令-增删改查

mysql常用语句命令(增删改查功能)