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