更新ElasticSearch映射
问题描述:
我有一个包含30,000.000个文档的索引。 我需要为即将到来的新文档添加一个新字段。 但我需要指定这个新字段的正确映射。更新ElasticSearch映射
此命令是否会导致已有文档的任何重新编排操作?
PUT /my_index/_mappings/my_type
{
"my_type": {
"properties": {
"A": {
"properties": {
"new_field": {
"type": "string",
"analyzer": "analyzer_keyword"
}
}
}
}
}
}
答
没有,上面的查询不会导致任何re-indexing
。这将只是在你的mapping.New字段中添加一个新的领域将得到补充,如果你update existing document
或create new document
。 有关更多详细信息,请参阅here。