赞
踩
安装教程跳过,此文档是基于kibana操作Elasticsearch
PUT /deocde
GET /_cat/indices?v
DELETE /decode
GET /_cat/indices?v
GET /decode/resolve/_mapping
PUT /decode/resolve/1
{
"vin": "B1293049555"
}
GET /decode/resolve/1
POST /decode/resolve/1/_update
{
"doc": { "vin": "A1299405555" }
}
DELETE /decode/reslove/1
POST /decode/resolve/_bulk
{"index":{"_id":"1"}}
{"vin": "D1445266366" }
{"index":{"_id":"2"}}
{"vin": "C4526365588" }
PUT /decode { "settings":{ "index":{ "number_of_shards":3, "number_of_replicas":0 } }, "mappings":{ "resolve":{ "properties":{ "id":{ "type":"keyword" }, "vin":{ "type":"keyword" }, "gender":{ "type":"keyword" }, "carBrandId":{ "type":"text" }, "balance":{ "type":"int" }, "age":{ "type":"int" }, "address":{ "type":"keyword" }, "craeteTime":{ "type":"date" }, "statusId":{ "type":"keyword" }, "enable":{ "type":"boolean" } } } } }
PUT es服务ip地址:9200/index_name/_mapping
PUT decode/_mapping
{
"properties": {
"fieldName":{
"type":"boolean"
}
}
}
GET /decode/resolve/_search
{
"query": { "match_all": {} }
}
GET /decode/resolve/_search
{
"query": { "match_all": {} },
"from": 0,
"size": 10
}
GET /decode/resolve/_search
{
"query": { "match_all": {} },
"sort": { "createTime": { "order": "desc" } }
}
GET /decode/resolve/_search
{
"query": { "match_all": {} },
"_source": ["id", "createTime"]
}
GET /decode/resolve/_search
{
"query": {
"match": {
"id": 20
}
}
}
GET /decode/resolve/_search
{
"query": {
"match": {
"address": "mill"
}
},
"_source": [
"address",
"id"
]
}
GET /decode/resolve/_search
{
"query": {
"match_phrase": {
"address": "mill lane"
}
}
}
GET /decode/resolve/_search
{
"query": {
"bool": {
"must": [
{ "match": { "address": "mill" } },
{ "match": { "address": "lane" } }
]
}
}
}
GET /decode/resolve/_search
{
"query": {
"bool": {
"should": [
{ "match": { "address": "mill" } },
{ "match": { "address": "lane" } }
]
}
}
}
GET /decode/resolve/_search
{
"query": {
"bool": {
"must_not": [
{ "match": { "address": "mill" } },
{ "match": { "address": "lane" } }
]
}
}
}
GET /decode/resolve/_search
{
"query": {
"bool": {
"must": [
{ "match": { "age": "40" } }
],
"must_not": [
{ "match": { "state": "ID" } }
]
}
}
}
GET /decode/resolve/_search { "query": { "bool": { "must": { "match_all": {} }, "filter": { "range": { "balance": { "gte": 20000, "lte": 30000 } } } } } }
GET /decode/resolve/_search
{
"size": 0,
"aggs": {
"group_by_vin": {
"terms": {
"field": "vin.keyword"
}
}
}
}
GET /decode/resolve/_search { "size": 0, "aggs": { "group_by_vin": { "terms": { "field": "vin.keyword" }, "aggs": { "average_balance": { "avg": { "field": "balance" } } } } } }
GET /decode/resolve/_search { "size": 0, "aggs": { "group_by_vin": { "terms": { "field": "vin.keyword", "order": { "average_balance": "desc" } }, "aggs": { "average_balance": { "avg": { "field": "balance" } } } } } }
GET /decode/resolve/_search { "size": 0, "aggs": { "group_by_age": { "range": { "field": "age", "ranges": [ { "from": 20, "to": 30 }, { "from": 30, "to": 40 }, { "from": 40, "to": 50 } ] }, "aggs": { "group_by_gender": { "terms": { "field": "gender.keyword" }, "aggs": { "average_balance": { "avg": { "field": "balance" } } } } } } } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。