elasticsearch 报错illegal_argument_exception

发布于 2020-08-14  1342 次阅读


1、需要开启聚合

聚合这些操作用单独的数据结构(fielddata)缓存到内存里了,需要单独开启,官方解释在此fielddata

例子如下:

发送put请求 PUT http://localhost:9200/megacorp/_mapping/employee/

JSON内容(请求体body)

{
 "properties": {
   "interests": {
     "type":     "text",
     "fielddata": true
  }
}
}

2、结果

{
   "acknowledged": true
}