使用curl操作ElasticSearch初步

1. 列明现有的所有index

curl -XGET 'localhost:9200/_cat/indices?v’
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open .kibana bndJD_c9RYGzu7XuWDyK9w 1 1 2 0 8.4kb 8.4kb

2. 创建新的index

curl -XPUT 'localhost:9200/customer?pretty'

{
"acknowledged" : true,
"shards_acknowledged" : true,
"index" : "customer"
}

3. 添加文档、查询文档
curl -XPUT 'localhost:9200/customer/doc/1?pretty&pretty' -H 'Content-Type: application/json' -d'

> {
> "name": "John Doe"
> }
> '
{
"_index" : "customer",
"_type" : "doc",
"_id" : "1",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 0,
"_primary_term" : 1
}

# query
curl -XGET 'localhost:9200/customer/doc/1?pretty&pretty'

{
"_index" : "customer",
"_type" : "doc",
"_id" : "1",
"_version" : 1,
"found" : true,
"_source" : {
"name" : "John Doe"
}
}

116 Comments

  1. Pingback: nike aq0067 800 epic react flyknit foamposite particles woven running shoes overseas version top deals

  2. Pingback: nike air max 2015 women black pink orange

  3. Pingback: nike lebron 15 pride of ohio black black taupe grey for sale

  4. Pingback: nike alpha talon

  5. Pingback: zoomnike air zoom huarache 2k4 all star retroblack varsity maize 308475 003

  6. Pingback: nike kobe 1 protro action green uk trainers

  7. Pingback: tshirt off white hoodie

  8. Pingback: handheld game systems

  9. Pingback: asics gel shoes

  10. Pingback: 斜械谢褘泄 胁芯谢褜褌 nike air zoom flight 95

  11. Pingback: uk trainers nike free 4.0 v3 print rust

  12. Pingback: adidas js metro attitude hi

  13. Pingback: uk trainers nike air huarache run ultra plum

  14. Pingback: black grey white air max 95 glitterkick

  15. Pingback: swarovski wedding shoes

  16. Pingback: uk trainers nike free 4.0 v2 dark red

  17. Pingback: nike 270 white womens pinterest.com

  18. Pingback: cheap nike shoes for boys twitter.com

  19. Pingback: gul volt nike sunray adjust 4

  20. Pingback: 銉娿偆銈?nike pg 2 榛?銈儸銉炽偢

  21. Pingback: kids jeremi hall 63 chicago bears jersey

  22. Pingback: other shoes parada shoes

  23. Pingback: nike kids nsw 12 zip pullover svartwolf gr blast boys rea

  24. Pingback: nike air force 1 low nike air force 1 low

  25. Pingback: performance nike roshe run

  26. Pingback: men nike air tech challenge hybrid red black white shoes huge high guarantee nike

  27. Pingback: asics gel saga sparkle

  28. Pingback: womens curry 4 grey white

  29. Pingback: nike air max sequent 3 dusty cactus

  30. Pingback: pepinmystep

  31. Pingback: printonlipro

  32. Pingback: kensie womens jersey pajama pants 95 rayon 5 spandex s pink

  33. Pingback: lepenequet

  34. Pingback: rwmconnects

  35. Pingback: hv519fsv

  36. Pingback: financewarm

  37. Pingback: cosmicupcake

  38. Pingback: netlandcafe

  39. Pingback: cynshq

  40. Pingback: shaansoftware

  41. Pingback: hollerrealtor

  42. Pingback: millertiregi

  43. Pingback: lapthelakes

  44. Pingback: amglawgroup

  45. Pingback: weissewelt

  46. Pingback: saint laurent wyatt 40 suede boots

  47. Pingback: adidas adizero crazy light vs. the other guys nike kobe 6 round 2

  48. Pingback: floraanafcheh

  49. Pingback: tkreative

  50. Pingback: world cup mini ball blue

  51. Pingback: jlredcross

  52. Pingback: tipicousa

  53. Pingback: hazalyildirim

  54. Pingback: saskostomy

  55. Pingback: kguides

  56. Pingback: getitcargo

  57. Pingback: royalhoneywax

  58. Pingback: mjnonghyup

  59. Pingback: 3d phone cases for samsung galaxy j2 prime

  60. Pingback: mayakstar

  61. Pingback: new balance 1500v4 t2

  62. Pingback: jesselyon

  63. Pingback: vspeyedoctors

  64. Pingback: ddpu3p9v

  65. Pingback: nowosadko

  66. Pingback: brotherfriend

  67. Pingback: scoptix

  68. Pingback: 4 ty beanie boo peanut the elephant2011 version ty beanie boo peanut the elephant2011 version

  69. Pingback: gaydaytrips

  70. Pingback: bluemoonocc

  71. Pingback: 2018 new men nike lebron ambassador 10 core black white

  72. Pingback: xhlvwang

  73. Pingback: sunglasses style guide wayfarer

  74. Pingback: pilaminates

  75. Pingback: 7x8rq331

  76. Pingback: thrasher logo thrasher symbol meaning history and evoluti

  77. Pingback: nike womens orange black shoes air max 87 top 10 kobe bryant shoes

  78. Pingback: acronyms next nike presto mid revealed

  79. Pingback: procomedian

  80. Pingback: eulatestnews

  81. Pingback: fixcustard

  82. Pingback: bambubaits

  83. Pingback: bhcsboosters

  84. Pingback: nike mens air jordan eclipse off court jordan list and prices

  85. Pingback: diamond snapback price

  86. Pingback: soccer coach equipment

  87. Pingback: luftsepp

  88. Pingback: wm x adidas eqt support bb3127 14

  89. Pingback: paul george t shirt jersey

  90. Pingback: jolyjulie

  91. Pingback: prorilpumpna

  92. Pingback: notiziefree

  93. Pingback: adidas trainers sale jd

  94. Pingback: metal soft pink braided nappa leather sandals

  95. Pingback: leather jacket for kids canberra fresh the north face kid s boy s rain jackets canberra the north face

  96. Pingback: p煤rpura rosado nike air max lunar 90 c3.0

  97. Pingback: lebron 14 womens 2017 nike lebron 14 nike lebron 14 what the sneakerfiles nike lebron 14

  98. Pingback: epiuenergia

  99. Pingback: green robin hood hat with feather vector illustration stockfoto 44096746

  100. Pingback: juventus yellow jersey for sale pa

  101. Pingback: uk women ladies ombre straight wig pink short

  102. Pingback: leather flip flops od rick owens

  103. Pingback: joannapage

  104. Pingback: scotivision

  105. Pingback: womens how much is a louis vuitton tote

  106. Pingback: womens dame 3 shoes for sale

  107. Pingback: dog hat menusing

  108. Pingback: nike dunk high 510

  109. Pingback: ray ban classic wayfarer tortoise shell

  110. Pingback: lroyroofing

  111. Pingback: michaelphenow

  112. Pingback: domodrzwi

  113. Pingback: millsbulb

  114. Pingback: air jordan 11 retro low hvit columbia bl氓

  115. Pingback: air jordan 1 lila and grau

  116. Pingback: elite mens ryan griffin navy blue jersey nfl nike houston texans 84 rush vapor untouchable

Leave Comment