Es常用Elasticsearch SQL查询语句

2021/9/17 19:05:37

本文主要是介绍Es常用Elasticsearch SQL查询语句,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

`# 多条件查询
GET /ailpha-saas-hiddendanger*/_search
{ "size":10,
"query": {
"bool": {
"must": [
{
"term": {
"dataFrom": "knownsec"
}
}
],
"must_not": [
{
"term": {
"eventFrom": "WebSOC"
}
},
{
"term": {
"eventFrom": "otherDiscover"
}
}
]
}
}
}

多条件查询

GET /ailpha-saas-hiddendanger*/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"dataFrom": "knownsec"
}
},
{
"term": {
"eventFrom": "otherDiscover"
}
}
]
}
}
}

条件删除

GET /ailpha-saas-hiddendanger*/_doc/_delete_by_query
{
"query": {
"bool": {
"must": [
{
"term": {
"dataFrom": "knownsec"
}
},
{
"term": {
"eventFrom": "otherDiscover"
}
}
]
}
}
}

多条件时间范围查询

GET /ailpha-saas-hiddendanger*/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"dataFrom": "knownsec"
}
},
{
"range": {
"endTime": {
"gte": "2021-9-01 00:00:00",
"lte": "2021-10-01 00:00:00"
}
}
}
]
}
}
}`



这篇关于Es常用Elasticsearch SQL查询语句的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程