我需要为现有索引启用“_size”。这个问题说这是可能的。但它没有提供如何做到这一点的例子。
根据“Put Mapping API”我执行了查询
curl -XPUT "localhost:9200/my_index/_mapping/my_type?pretty" -d '{
"properties": {
"_size": {
"enabled": true,
"store" : true
}
}
}'
并得到错误:
{
"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [_size]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [_size]"
},
"status" : 400
}
我的错误是什么?请显示此查询的正确版本。
您首先需要安装mapper-size 插件:
bin/elasticsearch-plugin install mapper-size
然后你就可以像这样启用它:
PUT my_index
{
"mappings": {
"my_type": {
"_size": {
"enabled": true
}
}
}
}
或者
PUT my_index/_mapping/my_type
{
"_size": {
"enabled": true
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句