es 中的坑

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 类型的 “” 否则不能排序了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值