Kibana創建索引成功,但一直不顯示出來(Fielddata is disabled on text fields by default. Set fielddata=true........)


現象

把EFK整個集群搭建完成后,通過Kibana操作界面創建索引(如圖1),我創建了lile-zabbix*的索引,顯示是創建成功了,但是只要我在重新刷新一次,已經創建的索引就“消失了”。后通過查看Kibana與ES的日志,均報錯如下

Caused by: java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [type] 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.

 

圖1:

 

一、版本信息

elasticsearch-7.4.1
kibana-7.4.1
filebeat-7.4.1

 

二、解決辦法

1、根據官網的信息,是對ES對應的索引的配置進行修改

2、因為我的索引是根據日期來的,所以今天對今天的索引進行了修改,明天的又得修改;所以我的是直接對我的模板配置進行修改,這樣只要是我這個模板下的索引,不管是現有的還是以后新添加的,都生效

PUT _template/lile_log   #lile_log:Template名稱
{
  "index_patterns": ["lile*"],    # 這里模板模板下的所有索引通用的前綴
  "mappings": {
      "properties": {
          "fielddata-*": {
              "type": "text",
              "fielddata": true
        }
      }
    }
}

 

三、結果

 

 

相關網址:

https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM