索引信息
查看索引信息
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XGET "http://127.0.0.1:9200/db_test?pretty=true" |
统计应用
分类统计查询
查询关键词为的文档, 并按照
type
分组(group by)
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
基础函数统计查询
查询评分最高评分和最低评分的文档(max|min|avg|sum)
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
统计信息查询
统计评分Top5的文档数
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
按照给定维度数据进行统计
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
查询评分的基本统计信息(count|min|max|avg|sum)
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
查询评分的高级统计信息
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
分段区间统计查询
分段统计指定区间内的评分和类型
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
直方图统计, 按照指定维度和步长值统计
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
过滤统计score=90,type=20的文档
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |
矩阵统计
1 | [root@localhost elasticsearch-6.0.0 ]$ curl -XPOST "http://127.0.0.1:9200/db_test/tb_opus/_search?pretty=true" -H 'Content-Type: application/json' -d' |