gpt4 book ai didi

elasticsearch - 在ElasticSearch 2中映射上下文建议者失败

转载 作者:行者123 更新时间:2023-12-03 01:56:36 25 4
gpt4 key购买 nike

更新到ElasticSearch 2之后,我不再能够为不同类型映射ContextSuggester:

PUT /test/foo/_mapping
{
"properties": {
"suggest": {
"type": "completion",
"context": {
"type": {
"type": "category",
"path": "_type",
"default": [
"foo"
]
}
}
}
}
}

PUT /test/bar/_mapping
{
"properties": {
"suggest": {
"type": "completion",
"context": {
"type": {
"type": "category",
"path": "_type",
"default": [
"bar"
]
}
}
}
}
}

将第二种类型的 map 放置在以下异常中结束:

Mapper for [suggest] conflicts with existing mapping in other types: [mapper [suggest] has different [context_mapping] values]



问题在于不同类型的默认值不同。在我看来,这应该是预期的方法。我怎么解决这个问题?

经测试的ES版本:2.2.1

最佳答案

您有现场冲突。

Mapping - field conflicts

Mapping types are used to group fields, but the fields in each mapping type are not independent of each other. Fields with:

  • the same name
  • in the same index
  • in different mapping types

map to the same field internally, and must have the same mapping. If a title field exists in both the user and blogpost mapping types, the title fields must have exactly the same mapping in each type. The only exceptions to this rule are the copy_to, dynamic, enabled, ignore_above, include_in_all, and properties parameters, which may have different settings per field.



创建单独的索引或将字段重命名为其他类型。

关于elasticsearch - 在ElasticSearch 2中映射上下文建议者失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36184789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com