how to set fielddata=true in kibana

前端 未结 5 2202
情话喂你
情话喂你 2020-12-24 10:58

I am new to Kibana, have data loaded into Elastic 5.0.0-alpha3 and am using Kibana 5.0.0-alpha3 to Visualise. I can display some numeric fields as histograms but when I want

5条回答
  •  失恋的感觉
    2020-12-24 11:20

    This code fixes this problem.

    PUT megacorp/_mapping/employee
    {
       "employee": {
          "properties": {
            "interests": {
              "type": "text",
              "fielddata": true
            }
          }
       }
    }
    

    So this code will run thereafter:

    GET /megacorp/employee/_search
        {
          "aggs": {
            "all_interests": {
              "terms": { "field": "interests"}
            }
          }
        }
    

提交回复
热议问题