栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

elasticsearch搜索入门

elasticsearch搜索入门

elasticsearch搜索入门

查看index查看node节点where treeCodes like '%xx%' order by createTime descselect count(*) from where treeCode like '%7330934%'select * from where treeCodes like '%xxx%';select enterpriseId,targetId where actionType = 1 order by enterpriseId descwhere actionType = 1 order by enterpriseId descwhere actionType = 1 limit 0 ,20where actionType = 1 group by enterpriseIdwhere actionType = 1 group by accountIdwhere accountId = ? and actionType in()group by accountIdwhere accountId = ? and actionType in() group by accountId

查看index

GET /_cat/indices?v

查看node节点

GET /_cat/nodes?v

where treeCodes like ‘%xx%’ order by createTime desc

GET env_account_change_2022_03_10/_search
{
“query”: {“match_phrase”: {
“treeCodes”: “729587218411520”
}},“sort”: [
{
“createTime”: {
“order”: “desc”
}
}
]
}

select count(*) from where treeCode like ‘%7330934%’

GET account_change_2022_03_09/_count
{
“query”: {“match_phrase”: {
“treeCodes”: 733093426640896
}
}
}

select * from where treeCodes like ‘%xxx%’;

GET account_change_2022_03_09/_search
{
“query”: {“match_phrase”: {
“treeCodes”: 733093426640896
}
}
}

select enterpriseId,targetId where actionType = 1 order by enterpriseId desc

GET account_change_2022_03_09/_search
{
“query”: {“match”: {
“actionType”: 1
}
},"_source": [“enterpriseId”,“targetId”]

}

where actionType = 1 order by enterpriseId desc

GET account_change_2022_03_09/_search
{
“query”: {“match”: {
“actionType”: 1
}
},“sort”: [
{
“enterpriseId”: {
“order”: “desc”
}
}
]
}

where actionType = 1 limit 0 ,20

GET account_change_2022_03_09/_search
{
“query”: {“match”: {
“actionType”: 1
}
},“size”: 20,“from”:0
}

where actionType = 1 group by enterpriseId

GET account_change_2022_03_09/_search
{
“query”: {“match”: {
“actionType”: 1
}
},“size”: 0,
“aggs”: {
“group_by_sector”: {
“terms”: {
“field”: “enterpriseId”,
“size”: 10
}
}
}
}

where actionType = 1 group by accountId

GET dev104_account_action_event_2022_03_09/_search
{
“size”: 0,
“query”: {
“match”: {
“actionType”: 1
}
},
“aggs”: {
“group_by_state”: {
“terms”: {
“field”: “accountId”
}
}
}
}

where accountId = ? and actionType in()

GET dev104_account_action_event_2022_03_09/_search
{
“query”: {
“bool”: {
“must”: [
{“match”: {
“accountId”: “730856098557952”
}}
],
“should”: [
{“match”: {
“actionType”: 1
}},
{
“match”: {
“actionType”: 2
}
}
]
}
}
}

group by accountId

GET dev104_account_action_event_2022_03_09/_search
{
“size”: 0,
“aggs”: {
“group_by_state”: {
“terms”: {
“field”: “accountId”
}
}
}
}

where accountId = ? and actionType in() group by accountId

GET dev104_account_action_event_2022_03_09/_search
{
“size”: 0,
“query”: {
“bool”: {
“must”: [
{“match”: {
“accountId”: “730856098557952”
}}
],
“should”: [
{“match”: {
“actionType”: 1
}},
{
“match”: {
“actionType”: 2
}
}
]
}
},
“aggs”: {
“group_by_state”: {
“terms”: {
“field”: “accountId”
}
}
}
}

参考: https://mp.weixin.qq.com/s?__biz=MzU1Nzg4NjgyMw%3D%3D&idx=1&mid=2247484699&scene=21&sn=5367206c3c3da2278821dd9fad648850#wechat_redirect

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/757859.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号