zoukankan      html  css  js  c++  java
  • 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"
              ]
            }
          }
        ]
      }
    }
  • 相关阅读:
    SpringBoot 日志
    springboot 自动配置
    性能测试步骤
    性能测试与压力测试
    Shell学习八:调用其它shell文件
    Shell学习七:重定向
    Linux mysql服务重启
    Shell学习六:流程控制
    Shell学习五:test参数的使用
    Shell学习四:echo和print输出
  • 原文地址:https://www.cnblogs.com/xiaoxiao1120/p/13372049.html
Copyright © 2011-2022 走看看