基本搜索12345678910111213{ "query": { "bool": { "must": [ { "match_all": {} } ] } }, "from": 0, "size": 1} Group BY1234567891011121314151617181920212223242526272829{ "query": { "bool": { "must": [ { "match_all": {} } ] } }, "from": 0, "size": 0, "aggregations": { "mid": { "aggregations": { "terminal": { "terms": { "field": "terminal", "size": 0 } } }, "terms": { "field": "mid", "size": "1" } } }} Distinct Count1234567891011121314151617181920{ "query": { "bool": { "must": [ { "match_all": {} } ] } }, "from": 0, "size": 0, "aggregations": { "COUNT(distinct (mid))": { "cardinality": { "field": "(mid)" } } }} 全文搜索12345{ "query" : { "query_string" : {"query" : "name:rcx"} }} match查询1234567{ "query": { "match": { "title": "crime and punishment" } }} 通配符查询1234567{ "query": { "wildcard": { "title": "cr?me" } }} 范围查询12345678910{ "query": { "range": { "year": { "gte" :1890, "lte":1900 } } }} 正则表达式查询12345678910{ "query": { "regexp": { "title": { "value" :"cr.m[ae]", "boost":10.0 } } }} 布尔查询123456789101112131415161718192021222324{ "query": { "bool": { "must": { "term": { "title": "crime" } }, "should": { "range": { "year": { "from": 1900, "to": 2000 } } }, "must_not": { "term": { "otitle": "nothing" } } } }} 更新123456index111/_doc/_30016/_update{ "doc": { "follow_status": "following" }} refresh