Elasticsearch query API Fielddata is disabled on text fields by default

GET /megacorp/employee/_search
{
  "aggs": {
    "all_interests": {
      "terms": { "field": "interests" }
    }
  }
}
# 报错:Fielddata is disabled on text fields by default
PUT megacorp/_mapping/employee/
{
  "properties": {
    "interests": { 
      "type":     "text",
      "fielddata": true
    }
  }
}

你可能感兴趣的:(Elasticsearch query API Fielddata is disabled on text fields by default)