elasticsearch 默认情况下,文本字段上的Fielddata被禁用 默认情况下,文本字段上禁用Fielddata,elasticsearch,kibana,metricbeat,elastic-beats,elasticsearch,Kibana,Metricbeat,Elastic Beats" /> elasticsearch 默认情况下,文本字段上的Fielddata被禁用 默认情况下,文本字段上禁用Fielddata,elasticsearch,kibana,metricbeat,elastic-beats,elasticsearch,Kibana,Metricbeat,Elastic Beats" />

elasticsearch 默认情况下,文本字段上的Fielddata被禁用 默认情况下,文本字段上禁用Fielddata

elasticsearch 默认情况下,文本字段上的Fielddata被禁用 默认情况下,文本字段上禁用Fielddata,elasticsearch,kibana,metricbeat,elastic-beats,elasticsearch,Kibana,Metricbeat,Elastic Beats,你好, 最近在我的elasticsearch设置中发生了一些奇怪的事情。Metricbeat索引被替换为一个新名称,旧名称类似于Metricbeat.x.date,但现在索引显示为Metricbeat。当尝试可视化时,版本和。我得到了下面的错误 错误: [esaggs] > Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"illegal_

你好,

最近在我的elasticsearch设置中发生了一些奇怪的事情。Metricbeat索引被替换为一个新名称,旧名称类似于Metricbeat.x.date,但现在索引显示为Metricbeat。当尝试可视化时,版本和。我得到了下面的错误

错误:

[esaggs] > Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [host.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"metricbeat-7.2.1","node":"iD4ffU_sR2-uLU_SP01Ukw","reason":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [host.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}}],"caused_by":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [host.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.","caused_by":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [host.name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}}},"status":400}
尝试过的解决方案:

在控制台中提供了以下内容

PUT my_index/_doc/host.name.keyword
{
"properties": {
"my_field": {
"type": "text",
"fielddata": true
}
}
}

#output:#
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "host.name",
"_version" : 1,
"_seq_no" : 0,
"_primary_term" : 1,
"found" : true,
"_source" : {
"properties" : {
"my_field" : {
"type" : "text",
"fielddata" : true
}
}
}
}
而且

PUT my_index/_doc/host.name
{
"properties": {
"my_field": {
"type": "text",
"fielddata": true
}
}
}

Output:
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "host.name",
"_version" : 2,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 2,
"_primary_term" : 2
}
有人能帮我解决这个问题吗。

这对你有帮助