首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如果对原始内容进行了分析,是否有必要重新分析elasticsearch copy_to?

如果对原始内容进行了分析,是否有必要重新分析elasticsearch copy_to?
EN

Stack Overflow用户
提问于 2017-04-07 07:11:22
回答 1查看 449关注 0票数 1

我们使用copy_to (自定义_all)进行elasticsearch映射。它只用于查询,不存储。我们使用“分析器”:“德语”来分析原始的file_content_de。我们是否也需要分析copy_to,ES文档对此并不十分清楚?

ES文档: https://www.elastic.co/guide/en/elasticsearch/guide/2.x/custom-all.html

代码语言:javascript
复制
    "attachment_contents_de": {
        "type": "string"
    },
    ...
    "file_content_de": {
        "type": "string",
        "analyzer": "german",
        "copy_to":  "attachment_contents_de",
        "include_in_all": false, 
        "store":true
    },
    ...
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-04-07 08:35:55

是的,您必须像官方文档所提到的那样分别分析复制的字段。

这并不意味着重新分析,copy_to将字符串值复制到字段,字段本身应该有自己的定义和定义的分析器。

代码语言:javascript
复制
Mappings of the first_name and last_name fields have no bearing on how the full_name field is indexed. The full_name field copies the string values from the other two fields, then indexes them according to the mapping of the full_name field only.

您可以使用合适的分析器为attachment_contents_de定义映射。

谢谢

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

https://stackoverflow.com/questions/43271824

复制
相关文章

相似问题

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