Fielddata is disabled on text fields by default

在昨天导入数据中,要一一对旧接口进行验证是否可行。
在尝试获取一个时间段的数据并排序时,发现了一个问题:
“type”: “illegal_argument_exception”,
“reason”: “Fielddata is disabled on text fields by default. Set fielddata=true on [cloud_time] 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.”
然后查了一下官方文档
Fielddata is disabled on text fields by default_第1张图片
按着这个把对应的字段设置为true。最后查询成功。
{
“properties”: {
“cloud_time”: {
“type”: “text”,
“fielddata”: true
}
}
}

你可能感兴趣的:(后端技术)