postman 可以直接访问 es有账号密码的认证
方案是 es 可以通过restful 认证
直接在postman header中添加认证方式
1 统计某个字段下的分组情况
类似如下功能:
select count(*) from mytable group by myfield
curl -XPOST ‘localhost:19200/ylchou-0-2015-10-07/_search?pretty’ -d ’
{
“size”: 0,
“aggs”: {
“group_by_state”: {
“terms”: {
“field”: “A_logtype”
}
}
}
}’
es 聚合设置 fielddata=true
https://blog.csdn.net/qq_43308337/article/details/89359219
https://www.cnblogs.com/shoufeng/p/11290669.html#%E5%85%88%E6%A3%80%E7%B4%A2-%E5%86%8D%E8%81%9A%E5%90%88
PUT my_index/_mapping/_doc
为userMoblie字段设置聚合索引
{
“properties”: {
“userMoblie”: {
“type”: “text”,
“fielddata”: true
}
}
}
https://www.elastic.co/guide/en/elasticsearch/reference/5.2/fielddata.html
查询字段的属性
http://172.17.4.157:9200/user_center/_mapping
范围操作符包含:
gt :: 大于
gte:: 大于等于
lt :: 小于
lte:: 小于等于
一定不要带 string 类型的 “” 否则不能排序了