ElasticSearch基礎操作

Paste_Image.png

Create an Index

PUT /customer?pretty

Index and Query a Document

PUT /customer/external/1?pretty
{
"name": "John Doe"
}

http://10.120.198.5:9200/customer/external/1?pretty/

Paste_Image.png

這時你會發現customer索引中新增了一條document記錄

Paste_Image.png

http://10.120.198.5:9200/customer/external/1?pretty/

查詢需要制定要查詢的縮影customer,索引的類型external,文檔的id pretty作用是json格式化
{
"_index" : "customer",
"_type" : "external",
"_id" : "1",
"_version" : 1,
"found" : true,
"_source" : { "name": "John Doe" }
}

Nothing out of the ordinary here other than a field, found, stating that we found a document with the requested ID 1 and another field, _source, which returns the full JSON document that we indexed from the previous step.

Delete an Index

DELETE /customer?pretty

Paste_Image.png
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 基礎概念 Elasticsearch有幾個核心概念,從一開始理解這些概念會對整個學習過程有莫大的幫助。 接近實時(...
    山天大畜閱讀 2,122評論 0 4
  • elasticsearch使用--簡單入門(一) 一、下載安裝 安裝java 下載elasticsearch相應版...
    ifeelok0319閱讀 332評論 0 0
  • 一些概念 索引-index: 一個索引就是一個擁有幾分相似特征的文檔的集合。比如說,你可以有一個客戶數據的索引,另...
    perfect_jimmy閱讀 3,556評論 0 0
  • 好久不用QQ開始習慣Tim了,微信呢也不太關注 剛用微信的時候很不習慣,因為每條朋友圈下面的評論,不是共同好友是看...
    走路帶風的紀小姐閱讀 98評論 0 1
  • 思科TechWise的這兩位老兄,非常牛叉,什么都懂。當然是什么都學。 看看這個視頻吧。有中文字幕。 http:/...
    taoza閱讀 251評論 0 2