美文网首页
Elastic Fielddata is disabled on

Elastic Fielddata is disabled on

作者: darcyaf | 来源:发表于2019-12-30 16:23 被阅读0次

es5.0 以后默认禁用了fielddata
解决方案:

  • 用.keyword
GET /megacorp/_search
{
  "aggs": {
    "all_interests": {
      "terms": { "field": "interests.keyword" }
    }
  }
}
  • 在聚合指令前先发送开始fielddata指令
PUT /megacorp/_mapping
{
  "properties":{
    "interests":{
      "type": "text",
      "fielddata": true
    }
  }
}

相关文章

网友评论

      本文标题:Elastic Fielddata is disabled on

      本文链接:https://www.haomeiwen.com/subject/emapoctx.html