首页 > 其他 > 详细

elasticsearch 基本查询语句

时间:2020-07-17 12:57:15      阅读:44      评论:0      收藏:0      [点我收藏+]
GET /_cat/indices?v


DELETE /logstash-2020.07.16?pretty


GET /logstash-2020.07.16/_search
{

  "query": { "match_all": {} },

  "size":1

}


GET /logstash-2020.07.14/_search
{
    "query": {
      "match": {
        "userID": "3482"
      }
    },
      "sort": { "@timestamp": { "order": "desc" }}

}

GET /logstash-2020.07.14/_search
{
  "query":{
    "constant_score": {
      "filter": {
        "range": {
          "datetime.keyword": {
            "format": "yyyy-MM-dd hh:mm:ss", 
            "gte":"2019-03-10 00:12:00",
            "lt": "2019-03-16 00:12:00"
          }
        }
      },
      "boost": 1.2
    }
  },
   "sort": { "datetime.keyword": { "order": "desc" }}
}

GET /logstash-2020.07.14/_search
{
  "query":{
    "range": {
      "@timestamp": {
        "gte": "2020-07-11T07:07:38.155Z",
        "lte": "2020-07-16T07:20:38.155Z"
      }
    }
  }
}


GET /logstash-2020.07.14/_search
{
  "query":{
    "range": {
      "datetime.keyword": {
        "gte": "2019-03-10 00:00:00",
        "lte": "2019-03-16 00:0:00"
      }
    }
  }
}

GET /logstash-2020.07.16/_search
{
   
  "query": {
    "bool": {
      "must": [{"match": {"userID": "768445"}}],
      "filter": [
              {"range": {
                "datetime.keyword": {
                  "gte": "2020-07-08 00:00:00",
                  "lte": "2020-07-20 00:00:00"
                }
              }}
            ]
    }
  }
  , "_source": {"excludes": ["agent","tags","input","log","@version","host","ecs"]},
  "sort": { "datetime.keyword": { "order": "desc" }}
}


GET /logstash-2020.07.14/_mapping

POST /_analyze/?pretty
{
  "analyzer": "ik_smart",
  "text": "我爱北京天安门"
}





GET /_analyze
{
    "text":"农业银行"
}

 

elasticsearch 基本查询语句

原文:https://www.cnblogs.com/wzy23/p/13328866.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!