kibana中操作elasticSearch 示例

GET /_cat/indices?v  
GET /_cat/nodes?v   

PUT /customer?pretty 

GET /customer?pretty

GET /logstash-indexer-qpeso-2019.05.23?pretty

PUT /customer/external/1?pretty
{ "name": "Jane qiao", "age": 20 }
PUT /customer/external/1?pretty
{
  "name": "qiao"
}

POST /customer/external/1/_update?pretty
{
  "doc": { "name": "Jane Doe" }
}

POST /customer/external/1/_update?pretty
{
  "doc": { "name": "Jane Doe", "age": 20 }
}

POST /customer/external/1/_update?pretty
{
"script" : "ctx._source.age += 5"
}

GET /customer/external/1?pretty

GET /customer/_search?q=*&pretty

POST /customer/_search?pretty
{
"query": { "match_all": {} },

"_source": ["name", "age"]


}

POST /customer/_search?pretty
{
"query": { "match": { "age": 20 } }

}

POST /customer/_search?pretty
{
 "query": { "match": { "name": "qiao doe" } }

}

POST /customer/_search?pretty
{
 "query": { "match_phrase": { "name": "qiao doe" } }

}

POST /customer/_search?pretty
{
"query": {
  "bool": {
    "must": [
       { "match": { "name": "qiao" } },
       { "match": { "name": "Jane" } }
      ]
    }
  }
}

POST /customer/_search?pretty
{
"query": {
  "bool": {
    "should": [
       { "match": { "name": "qiao" } },
       { "match": { "name": "Doe" } }
      ]
    }
  }
}

POST /customer/_search?pretty
{
"query": {
  "bool": {
    "must_not": [
       { "match": { "name": "qiao" } },
       { "match": { "name": "Doe" } }
      ]
    }
  }
}


POST /customer/_search?pretty
{
"query": { "match_all": {} },

"size": 1
}

POST /customer/_search?pretty
{
"query": { "match_all": {} },

"from": 10,

"size": 10
}


{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 3,
    "max_score": 0.25811607,
    "hits": [
      {
        "_index": "customer",
        "_type": "external",
        "_id": "2",
        "_score": 0.25811607,
        "_source": {
          "name": "John1111 Doe"
        }
      },
      {
        "_index": "customer",
        "_type": "external",
        "_id": "1",
        "_score": 0.25811607,
        "_source": {
          "name": "Jane qiao",
          "age": 20
        }
      },
      {
        "_index": "customer",
        "_type": "external",
        "_id": "3",
        "_score": 0.25811607,
        "_source": {
          "name": "John1111 Doe",
          "age": 20
        }
      }
    ]
  }
}


DELETE /customer/external/2?pretty

DELETE /customer?pretty

 

參考文章:http://www.ituring.com.cn/book/tupubarticle/18380

                 https://www.cnblogs.com/pilihaotian/p/5830754.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章