【发布时间】:2015-07-10 08:12:21
【问题描述】:
我有一个 ElasticSearch 类型,我希望为其动态设置映射。我要分析该类型的一些选择字段,但其他所有内容都应设置为“not_analyzed”。
我想出了以下 sn-p。这会将所有 string 字段设置为不被分析,但不涵盖所有其他数据类型。我尝试使用文档中显示的“通用”字段,但没有帮助。谁能告诉我如何做到这一点?
{
"TypeName": {
"dynamic_templates": [
{
"template_name": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"index": "no",
"type": "string"
}
}
}
],
"dynamic": true,
"properties": {
"url": {
"index": "analyzed",
"type": "string"
},
"resourceUrl": {
"index": "analyzed",
"type": "string"
}
}
}
}
【问题讨论】:
标签: elasticsearch