kibana es操作

GET /persondocument/_search
{
  "_source": ["name"],
  "query": {
    "wildcard": {"name":{"value": "888*"}}
  }
}
#查询所有索引库
GET _cat/indices

#查看persondocument表结构
GET /persondocument/_mapping/

#创建索引 
 PUT my_index
{
  "mappings": {
      "properties": {
        "name": {
          "type": "keyword"
        }
      }
  }
}
 
GET /my_index/_mapping/ 
 
 GET /km_doc/_mapping
 
#查询所有记录,返回fileNo
GET /km_doc/_search
{
  "_source": ["fileNo"],
  "query" :{
      "match_all":{}
   }
}
#es中text和keyword的区别
#text
# 会分词,然后索引
# 支持模糊,精确搜索
# 不支持聚合
#keyword
# 直接索引
# 支持模糊,精确搜索
# 支持聚合
#按fileNo分组查询
GET /km_doc/_search
{
  "_source": ["fileNo"],
"aggregations": {
				"ABC": {
					"terms": {
						"field": "fileNo"
					}
				}
			}
}


版权声明:本文为tonysh_zds原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。