Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. ```json
  2. GET _search
  3. {
  4. "query": {
  5. "match_all": {}
  6. }
  7. }
  8.  
  9.  
  10. GET /
  11.  
  12. # Lab 3: CRUD Operations
  13.  
  14. PUT my_blogs/_doc/1
  15. {
  16. "id": "1",
  17. "title": "Better query execution",
  18. "category": "Engineering",
  19. "date":"July 15, 2015",
  20. "author":{
  21. "first_name": "Adrian",
  22. "last_name": "Grand",
  23. "company": "Elastic"
  24. }
  25. }
  26.  
  27. PUT my_blogs/_doc/2
  28. {
  29. "id": "2",
  30. "title": "The Story of Sense",
  31. "date":"May 28, 2015",
  32. "author":{
  33. "first_name": "Boaz",
  34. "last_name": "Leskes"
  35. }
  36. }
  37.  
  38.  
  39. POST my_blogs/_doc/
  40. {
  41. "id": "57",
  42. "title": "Phrase Queries: a world without Stopwords",
  43. "date":"March 7, 2016",
  44. "category": "Engineering",
  45. "author":{
  46. "first_name": "Gabriel",
  47. "last_name": "Moskovicz"
  48. }
  49. }
  50.  
  51.  
  52. GET my_blogs/_doc/1
  53.  
  54. DELETE my_blogs/_doc/1
  55.  
  56. GET my_blogs/_doc/1
  57.  
  58.  
  59. POST my_blogs/_bulk
  60. {"update": {"_id": 2}}
  61. {"doc": {"category": "Engineering", "author.company":"Elastic"}}
  62. {"index": {"_id": 3}}
  63. {"title":"Using Elastic Graph","category":"Engineering","date":"May 25, 2016","author":{"first_name":"Mark","last_name":"Harwood","company":"Elastic"}}
  64.  
  65. GET my_blogs/_search
  66.  
  67. GET my_blogs/_mget
  68. {
  69. "docs": [
  70. {"_id":2},
  71. {"_id":3}
  72. ]
  73. }
  74.  
  75. DELETE my_blogs
  76.  
  77. # see all indices
  78. GET _cat/indices
  79.  
  80. # search all documents in index
  81. GET blogs/_search
  82.  
  83. # num of docs in index
  84. GET blogs/_count
  85.  
  86.  
  87. GET logs_server1,logs_server2,logs_server3/_count
  88. GET logs_server*/_count
  89. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement