gpt4 book ai didi

elasticsearch - elasticsearch映射动态模板

转载 作者:行者123 更新时间:2023-12-02 23:37:51 25 4
gpt4 key购买 nike

我的映射有什么问题?我收到:

{"error":"ClassCastException[java.util.LinkedHashMap cannot be cast to java.util.List]","status":500}

我在ubuntu服务器上使用ElasticSearch 1.1.1。
如果我删除动态模板,则可以使用
$this->mapping = [
"dynamic_templates" => [
'all_fields' => [
'match' => "*",
'match_mapping_type' => 'string',
'mapping' => [
'index' => 'not_analyzed',
],
],
],
'properties' => [
'state' => [
'type' => 'boolean',
],
...
];
}

最佳答案

映射应如下所示:

"dynamic_templates" => [
['all_fields' => [
'match' => "*",
'match_mapping_type' => 'string',
'mapping' => [
'index' => 'not_analyzed',
],
]],
],

请注意,字段定义应该是标量数组内的关联数组。

关于elasticsearch - elasticsearch映射动态模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28277988/

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