zoukankan      html  css  js  c++  java
  • elasticsearch7.7-postman-json脚本

    {
    "info": {
    "_postman_id": "7745c9e1-e87f-4385-adc9-16bc2ea8efc0",
    "name": "es7.7.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
    {
    "name": "获取",
    "item": [
    {
    "name": "分页排序获取",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "match_all": {} }, "sort": [ { "account_number": "asc" } ], "from": 1, "size": 3 }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "获取指定主键",
    "request": {
    "method": "GET",
    "header": [],
    "body": {
    "mode": "raw",
    "raw": ""
    },
    "url": {
    "raw": "http://{{http_ip_port}}/customer/_doc/1?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "customer",
    "_doc",
    "1"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "获取指定单词",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "match": { "address": "mill lane" } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    },
    "description": "单词可多个,空格隔开,每个单词都是独立搜索"
    },
    "response": []
    },
    {
    "name": "获取指定内容",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "match_phrase": { "address": "Kings Place" } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    },
    "description": "match_phrase是查找短语,会将搜索内容作为整体进行匹配,对于field来说仍然是模糊匹配,这个例子类比mysql中的 address like '%mill lane%'"
    },
    "response": []
    },
    {
    "name": "多条件获取",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "bool": { "must": [ { "match": { "age": "40" } } ], "must_not": [ { "match": { "state": "ID" } } ] } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "多条件获取1",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "bool": { "must": [ { "match_phrase": { "address": "mill lane" } } ], "must_not": [ { "match": { "age": "40" } } ], "filter": { "range": { "balance": { "gte": 40000, "lte": 50000 } } } } }, "sort": [ { "account_number": "asc" } ], "from": 0, "size": 2 }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "过滤器获取",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "query": { "bool": { "must": { "match_all": {} }, "filter": { "range": { "balance": { "gte": 20000, "lte": 30000 } } } } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "聚合查询",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "size": 0, "aggs": { "group_by_state": { "terms": { "field": "state.keyword" ,"size": 2 } } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "复杂聚合查询1-分组求和",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "size": 0, "aggs": { "group_by_state": { "terms": { "field": "state.keyword" }, "aggs": { "average_balance": { "avg": { "field": "balance" } } } } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "复杂聚合查询2-分组求和排序",
    "protocolProfileBehavior": {
    "disableBodyPruning": true
    },
    "request": {
    "method": "GET",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "size": 0, "query": { "bool": { "filter": { "range": { "age": { "gte": 40 } } } } }, "aggs": { "group_by_state": { "terms": { "field": "state.keyword", "order": { "average_balance": "desc" }, "size": 2, "shard_size": 4 }, "aggs": { "average_balance": { "avg": { "field": "balance" } }, "stats_balance": { "stats": { "field": "balance" } } } } } }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_search?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_search"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    }
    ]
    },
    {
    "name": "插入",
    "item": [
    {
    "name": "插入索引",
    "request": {
    "method": "PUT",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "name": "John Doe" }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/customer/_doc/1?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "customer",
    "_doc",
    "1"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "批量插入索引",
    "request": {
    "method": "POST",
    "header": [
    {
    "key": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "file",
    "file": {}
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_bulk?pretty&refresh",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_bulk"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    },
    {
    "key": "refresh",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "插入指定id数据",
    "request": {
    "method": "PUT",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{"account_number":1047,"balance":164118,"firstname":"Elinor1","lastname":"Ratliff1","age":38,"gender":"M","address":"283 Kings Place","employer":"Scentric1","email":"elinorratliff@scentric.com","city":"Ribera","state":"WA"}"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/bank/_doc/1047",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "bank",
    "_doc",
    "1047"
    ]
    }
    },
    "response": []
    },
    {
    "name": "更新数据",
    "request": {
    "method": "POST",
    "header": [
    {
    "key": "Content-Type",
    "name": "Content-Type",
    "value": "application/json",
    "type": "text"
    }
    ],
    "body": {
    "mode": "raw",
    "raw": "{ "name": "John Doe" }"
    },
    "url": {
    "raw": "http://{{http_ip_port}}/customer/_doc?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "customer",
    "_doc"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    }
    ]
    },
    {
    "name": "es信息",
    "item": [
    {
    "name": "查看集群索引信息",
    "request": {
    "method": "GET",
    "header": [],
    "body": {
    "mode": "raw",
    "raw": ""
    },
    "url": {
    "raw": "http://{{http_ip_port}}/_cat/indices?v",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "_cat",
    "indices"
    ],
    "query": [
    {
    "key": "v",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "查看集群状态",
    "request": {
    "method": "GET",
    "header": [],
    "body": {
    "mode": "raw",
    "raw": ""
    },
    "url": {
    "raw": "http://{{http_ip_port}}/_cat/health?v",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "_cat",
    "health"
    ],
    "query": [
    {
    "key": "v",
    "value": null
    }
    ]
    }
    },
    "response": []
    }
    ]
    },
    {
    "name": "删除",
    "item": [
    {
    "name": "删除指定id",
    "request": {
    "method": "DELETE",
    "header": [],
    "body": {
    "mode": "raw",
    "raw": ""
    },
    "url": {
    "raw": "http://{{http_ip_port}}/customer/_doc/1?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "customer",
    "_doc",
    "1"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    },
    {
    "name": "删除索引",
    "request": {
    "method": "DELETE",
    "header": [],
    "body": {
    "mode": "raw",
    "raw": ""
    },
    "url": {
    "raw": "http://{{http_ip_port}}/customer?pretty",
    "protocol": "http",
    "host": [
    "{{http_ip_port}}"
    ],
    "path": [
    "customer"
    ],
    "query": [
    {
    "key": "pretty",
    "value": null
    }
    ]
    }
    },
    "response": []
    }
    ]
    }
    ]
    }

  • 相关阅读:
    Docker系列三:Docker容器管理
    Docker系列一:Docker基本概念及指令介绍
    MySQL数据库“十宗罪”(十大经典错误案例)
    用数据驱动渠道推广(下:数据篇)
    用数据驱动渠道推广(上:工具篇)
    日留存、周留存、月留存,究竟怎样才能让更多的用户留下来?
    MySQL中的联合索引学习教程
    VC++NMAKE
    一元三次方程求根公式
    一元四次方程求根公式
  • 原文地址:https://www.cnblogs.com/wish5714/p/13072868.html
Copyright © 2011-2022 走看看