ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ # 获取某个索引信息 GET /library/_mapping # 获取某个索引下某个type的映射信息 GET /library/_mapping/books # 获取这个集群内所有的映射信息 GET /_all/_mapping # 获取这个集群内某两个或多个type的映射信息 GET /_all/_mapping/books,bank_account Hello hello are you you can call me if you want to come over for a little time and I have a lot of of them them and the other two are is # 更新修改Mapping映射 # 很遗憾,mapping一旦建立,就不能修改现有的字段映射 # 如果要推到现有的映射,你得重新建立一个索引,然后重新定义映射 # 然后把之前索引里的数据导入到新建立的索引里 # ------具体方法------- # 1. 给现有的索引定义一个别名,并且把现有的索引指向这个别名,运行步骤2 # 2. 运行: PUT /现有索引/_alias/别名A # 3. 新创建一个索引,定义好最新的映射 # 4. 将别名指向新的索引,并且取消之前索引的指向,运行步骤5 # 5. 运行 POST /_aliases { "actions": [ {"remove": {"index":"现有索引名", "alias":"别名A"}}, {"add": {"index":"新建索引名", "alias":"别名A"}} ] } # 注: 通过这几个步骤就实现了索引的平滑过渡,并且是零停机的 # 删除映射 DELETE /library/books DELETE /library/books/_mapping DELETE /library/_mapping/books ~~~