ES权威指南[官方文档学习笔记]-8
生活随笔
收集整理的這篇文章主要介紹了
ES权威指南[官方文档学习笔记]-8
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
2019獨角獸企業重金招聘Python工程師標準>>>
es:http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/_indexing_employee_documents.html
下一篇博客:http://my.oschina.net/qiangzigege/blog/263627
內容:
第一任務是存儲雇員數據,一個文檔代表一個雇員, es里的存儲叫做索引。 需要決定在哪存儲。 在es里,一個文檔屬于一個type,很多types在一個index里。和關系型數據庫比較如下: Relational DB Databases Tables Rows Columns Elasticsearch Indices Types Documents Fields一個index表示一個數據庫, 一個es集群里可以有多個索引,每個索引包含多個types. 每個type包含多個documents,每個document包含多個fields.索引每一個文檔 每個文檔的type: employee 每個文檔的index: megacorp 集群:PUT /megacorp/employee/1 {"first_name" : "John","last_name" : "Smith","age" : 25,"about" : "I love to go rock climbing","interests": [ "sports", "music" ] }the path /megacorp/employee/1 包含三個信息。 megacorp ---index employee ---type 1 ---雇員ID 請求體則包含雇員信息。這里并沒有直接建立索引,一切都在后臺默認方式進行。再添加一些文檔。 PUT /megacorp/employee/2 {"first_name" : "Jane","last_name" : "Smith","age" : 32,"about" : "I like to collect rock albums","interests": [ "music" ] }PUT /megacorp/employee/3 {"first_name" : "Douglas","last_name" : "Fir","age" : 35,"about": "I like to build cabinets","interests": [ "forestry" ] }
?
轉載于:https://my.oschina.net/qiangzigege/blog/263612
總結
以上是生活随笔為你收集整理的ES权威指南[官方文档学习笔记]-8的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: hackerrank---Sets -
- 下一篇: defer与async的认识