當我嘗試加載可視化文件時,在獲取Kibana中的以下錯誤。在Elasticsearch中使用文本字段進行聚合
可視化:默認情況下,字段數據在文本字段上被禁用。在[beat.name]上設置fielddata = true,以便通過取消倒置索引來加載內存中的fielddata。請注意,這可以使用大量的內存。
因此,我嘗試添加未啓用關鍵字字段的doc_values啓用聚合按照此LINK。
因爲我每天創建索引我創建了一個模板:
PUT /_template/template_metricbeat_1
{
"template": "*metricbeat*",
"order": 1,
"settings": {
"number_of_shards": 5,
"number_of_replicas": 1,
"refresh_interval": "30s"
},
"mappings": {
"metricsets": {
"properties": {
"beat.name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
}
}
但我會在創造可視化可以使用大約五十文本字段。
所以我的問題是如何添加unanalyzed關鍵字字段與我所有的五十個文本字段一氣呵成?
你使用默認metricbeat模板? 'beat.name'字段已經是'關鍵字'了:https://github.com/elastic/beats/blob/v5.3.0/metricbeat/metricbeat.template.json#L191 –
謝謝,它工作。你可以添加它作爲答案,以便我可以接受它。 – Zeeshan