查询了下生产环境的fielddata状态,发现都是相关属性都是0,怎么样让fielddata缓存起作用呢?
fielddata情况如下:
{
"_shards": {
"total": 15,
"successful": 15,
"failed": 0
},
"_all": {
"primaries": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
},
"total": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
}
},
"indices": {
"product": {
"primaries": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
},
"total": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
}
}
}
}
fielddata情况如下:
{
"_shards": {
"total": 15,
"successful": 15,
"failed": 0
},
"_all": {
"primaries": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
},
"total": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
}
},
"indices": {
"product": {
"primaries": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
},
"total": {
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0,
"fields": {}
}
}
}
}
}
2 个回复
stab - freshman
赞同来自:
bng
赞同来自:
field定义的时候,需要把doc_values设置为false。
比如说,这样:
"storeId": { "store": true, "type": "long", "doc_values": false, "fielddata": { "loading" : "eager" } }
不过有了fielddata缓存之后,聚合的时候也没有快多少。