term的多种查询
关键字 | 用处 |
---|---|
term | 精准查询 |
exists | 特定字段非空 |
prefix | 包含前缀 |
wildcard | 通配符查询 |
regexp | 正则表达式查询( |
ids | 多值查询 |
范围查询
gte—lte
范围为时间时,用format"dd-MM-yyyy"
布尔查询
type | description |
---|---|
must(must_not) | 必须(必须不)出现在匹配?档中 |
filter | 必须出现在?档中,但是不打分 |
must_not | 不能出现在?档中 |
should | 应该出现在?档中(可配合配合minimum_should_match=?) |
排序查询
desc降序,asc升序
聚合查询(指标聚合,桶聚合)
指标聚合:对?个数据集求最?、最?、和、平均值等指标的聚合
桶聚合:对查询出的数据进?分组group by,再在组上进行指标聚合。
type | description |
---|---|
Cardinality | 去重 |
stats | 同时统计count,max,min,avg,sum5个值 |
Extended | 比stats多四个值:平方和,方差,标准差,平均值加/减标准差 |
pecentiles | 占比[ 1, 5, 25, 50, 75, 95, 99 ]分位上的百分位统计 |
query_string查询
单个字段 default_field
多个字段 fields
索引别名
新增别名 add
删除别名 remove
重命名 add,remove
重建索引
- nba取?个别名nba_latest, nba_latest作为对外使?
- 新增?个索引nba_20220101,结构复制于nba索引,根据业务要求修改字段
- 将nba数据同步到nba_20220101
- 给nba_20220101添加别名nba_latest,删除nba别名nba_latest
- 删除nba索引