首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticSearch -重新索引以添加doc_value

ElasticSearch -重新索引以添加doc_value
EN

Stack Overflow用户
提问于 2015-06-14 12:53:05
回答 1查看 191关注 0票数 0

我到底想做什么?

将doc_type添加到现有索引中。

我试过什么?

创建索引和文档

代码语言:javascript
复制
POST /my_index-1/my_type/1
{
    "my_prop": "my_value"
}

添加了一个模板

代码语言:javascript
复制
PUT /_template/my_template
{
    "id": "my_template",
    "template": "my_index-*",
    "mappings": {
        "_default_": {
            "dynamic_templates": [
                {
                    "my_prop_template": {
                        "mapping": {
                            "index": "not_analyzed",
                            "doc_values": true,
                            "fielddata": {
                                "format": "doc_values"
                            },
                            "type": "string"
                        },
                        "match": "my_prop",
                        "match_mapping_type": "string"
                    }
                }
            ]
        }
    }
}

重新编制索引

代码语言:javascript
复制
./stream2es es --source http://localhost:9200/my_index-1 --target http://localhost:9200/my_index-2

哪里出了问题?

在新索引my_index-2中,属性没有接收到"doc_values": true

代码语言:javascript
复制
...
"properties": {
    "my_prop": {
        "type": "string"
    }
}
...
  • 为了保持清醒,我还尝试将相同的文档添加到我的_index-3中,并得到了"doc_values": true

我的问题

如何用"doc_values": true重新编制旧索引

EN

回答 1

Stack Overflow用户

发布于 2015-06-15 11:51:51

谢谢@Val!洛格斯塔什确实解决了这个问题。

stream2eselasticsearch重新索引都创建了没有“doc_values”的新映射: true。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30829603

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档