postman對ES的交互


Get 查看所有索引

localhost:9200/_all

PUT 創建索引-test

localhost:9200/test  


DEL 刪除索引-test

localhost:9200/test  


PUT 創建索引-person-1

localhost:9200/person


PUT 新增數據-person-1

localhost:9200/person/_doc/1

{
    "first_name" : "John",
  "last_name" : "Smith",
  "age" : 25,
  "about" : "I love to go rock climbing",
  "interests" : [ "sports", "music" ]
}

PUT 新增數據-person-2

localhost:9200/person/_doc/2

{
    "first_name" : "Eric",
  "last_name" : "Smith",
  "age" : 23,
  "about" : "I love basketball",
  "interests" : [ "sports", "reading" ]
}

GET 搜索數據-person-id

localhost:9200/person/_doc/1

GET 搜索數據-person-name

localhost:9200/person/_doc/_search?q=first_name:john

{
  "took": 56,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 0.6931472,
    "hits": [
      {
        "_index": "person",
        "_type": "_doc",
        "_id": "1",
        "_score": 0.6931472,
        "_source": {
          "first_name": "John",
          "last_name": "Smith",
          "age": 25,
          "about": "I love to go rock climbing",
          "interests": [
            "sports",
            "music"
          ]
        }
      }
    ]
  }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM