为存在的索引启用 _size
Enable _size for exist index
我需要启用 "_size" for an exist index. 说这是可能的。但它没有提供如何操作的示例。
根据"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 plugin:
bin/elasticsearch-plugin install mapper-size
然后你就可以像这样启用它了:
PUT my_index
{
"mappings": {
"my_type": {
"_size": {
"enabled": true
}
}
}
}
或
PUT my_index/_mapping/my_type
{
"_size": {
"enabled": true
}
}
我需要启用 "_size" for an exist index.
根据"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 plugin:
bin/elasticsearch-plugin install mapper-size
然后你就可以像这样启用它了:
PUT my_index
{
"mappings": {
"my_type": {
"_size": {
"enabled": true
}
}
}
}
或
PUT my_index/_mapping/my_type
{
"_size": {
"enabled": true
}
}