Kibana ES 創建索引命令


刪除舊索引

  DELETE 索引名

創建新索引

PUT 索引名
{
  "settings": {
    "index": {
      "number_of_shards": "3",
      "number_of_replicas": "0"
    }
  }
}

設置索引mapping

PUT 索引名/_doc/_mapping
{
     
        "properties": {
          "id": {
            "type": "keyword"
          },
        
          "day": {
            "type": "integer"
          },
          "count": {
            "type": "double"
          },
          "level": {
            "type": "integer"
          }
      
}

 

這里要注意,如果是用http方式創建的話,mapping需要帶s:mappings。如下:

 

 設置別名

POST _aliases
{
  "actions" : [{"add" : {"index" : "索引名" , "alias" : "別名"}}]
}

 https://blog.csdn.net/seanxwq/article/details/115175399


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM