我正在对 Elasticsearch 字段进行排序,但它给了我一个错误。
我这样做:
s = s.sort({'productForm': {"order": "desc"}})
我收到以下错误
RequestError(400, u'search_phase_execution_exception', u'Fielddata is disabled on text fields by default. Set fielddata=true on [productForm] 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.')
我知道字段需要是 type 关键字,所以我的映射是这样的
},
"productForm": {
"analyzer": "keyword",
"type": "text"
},
我缺少什么来完成这项工作
谢谢
授予