es入門

查看es的健康狀態

http://10.1.18.37:8211/_cat/health?v

查看所有的索引

get http://10.1.18.37:8211/_cat/indices?v

創建索引,在postman執行的時候需要設置爲json數據格式

PUT /test_index?pretty

索引內容

{
 "settings":{
    "number_of_shards":3,
    "number_of_replicas":1
 },
 "mappings":{
      
        "properties":{
          "word_count":{"type":"integer"},
          "author":{"type":"keyword"},
          "title":{"type":"text"},
          "publish_date":{
          "type":"date",
          "format":"yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
          }
        }      
      
 }
}

 

一些說明

settings 設置
number_of_shards 分片數
number_of_replicas 副本數
mappings 結構化數據設置
mappings下面的一級屬性 是自定義的類型
properties 類型的屬性設置節點,下面都是屬性
epoch_millis表示時間戳

 

發佈了102 篇原創文章 · 獲贊 24 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章