查询排序(聚合)时报错: Caused by: java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [cityInitial] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively u se a keyword field instead. PUT your_index/_mapping/your_type { "your_type": { "properties": { "publisher": { "type": "text", "fielddata": true } } } }
如:
PUT micro_mall_distribute/_mapping/goods
{
"goods": {
"properties": {
"cityInitial": {
"type": "text",
"fielddata": true
}
}
}
}