发布于2021-06-06 17:13 阅读(971) 评论(0) 点赞(4) 收藏(0)
需要注意的是,post请求创建document的时候,是不满足幂等性的,每一次请求都是创建一个新的document。在没有明确指定id的情况下,每一个创建的document都会自动分配一个唯一id。
- {
- "info": {
- "_postman_id": "96f242ab-9ed9-4540-9fde-9feec40b1791",
- "name": "ElasticSearch",
- "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
- },
- "item": [
- {
- "name": "base option",
- "item": [
- {
- "name": "index options",
- "item": [
- {
- "name": "get all index",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/_cat/indices?v",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "_cat",
- "indices"
- ],
- "query": [
- {
- "key": "v",
- "value": null
- }
- ]
- }
- },
- "response": []
- },
- {
- "name": "delete index",
- "request": {
- "method": "DELETE",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping"
- ]
- }
- },
- "response": []
- },
- {
- "name": "create index",
- "request": {
- "method": "PUT",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping"
- ]
- }
- },
- "response": []
- },
- {
- "name": "get index",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping"
- ]
- }
- },
- "response": []
- }
- ]
- },
- {
- "name": "document options",
- "item": [
- {
- "name": "create document",
- "protocolProfileBehavior": {
- "disabledSystemHeaders": {}
- },
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"title\" : \"小米10\",\r\n \"brand\" : \"小米\",\r\n \"price\" : 4000\r\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_doc",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_doc"
- ]
- }
- },
- "response": []
- },
- {
- "name": "get document info",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_doc/7pbvzHkBYAUbzfBKmCoR",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_doc",
- "7pbvzHkBYAUbzfBKmCoR"
- ]
- }
- },
- "response": []
- },
- {
- "name": "get all document",
- "request": {
- "method": "GET",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_search",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_search"
- ]
- }
- },
- "response": []
- },
- {
- "name": "update document all content",
- "request": {
- "method": "PUT",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"title\" : \"小米11\",\r\n \"brand\" : \"小米\",\r\n \"price\" : 4001\r\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_doc/7pbvzHkBYAUbzfBKmCoR",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_doc",
- "7pbvzHkBYAUbzfBKmCoR"
- ]
- }
- },
- "response": []
- },
- {
- "name": "update document",
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"doc\" : {\r\n \"title\" : \"小米30\"\r\n }\r\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_update/7pbvzHkBYAUbzfBKmCoR",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_update",
- "7pbvzHkBYAUbzfBKmCoR"
- ]
- }
- },
- "response": []
- },
- {
- "name": "delete document",
- "request": {
- "method": "DELETE",
- "header": [],
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_doc/7ZbvzHkBYAUbzfBKhCoL",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_doc",
- "7ZbvzHkBYAUbzfBKhCoL"
- ]
- }
- },
- "response": []
- },
- {
- "name": "create document with id",
- "request": {
- "method": "POST",
- "header": [],
- "body": {
- "mode": "raw",
- "raw": "{\r\n \"title\" : \"小米10\",\r\n \"brand\" : \"小米\",\r\n \"price\" : 4000\r\n}",
- "options": {
- "raw": {
- "language": "json"
- }
- }
- },
- "url": {
- "raw": "http://127.0.0.1:9200/shopping/_doc/123abc",
- "protocol": "http",
- "host": [
- "127",
- "0",
- "0",
- "1"
- ],
- "port": "9200",
- "path": [
- "shopping",
- "_doc",
- "123abc"
- ]
- }
- },
- "response": []
- }
- ]
- }
- ]
- }
- ]
- }
作者:门路弄土了吗
链接:http://www.phpheidong.com/blog/article/88197/babbe18c8a61e7316fc5/
来源:php黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 php黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-4
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!