-
異常信息:
Fielddata is disabled on text fields by default. Set fielddata=true on [my_field] 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.
-
解決辦法:
默認(rèn)情況下 text 字段的 Fielddata 是禁用的颊埃。如果對(duì) text 字段中的進(jìn)行排序拧略,匯總或訪問(wèn)值供炼,則會(huì)看到上述異常雅宾。
可以對(duì) text 字段上啟用 Fielddata 解決恰响。curl -X PUT "localhost:9200/my_index/_mapping?pretty" -H 'Content-Type: application/json' -d' { "properties": { "my_field": { "type": "text", "fielddata": true } } } '
參考: https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html