I am doing a sort on an Elasticsearch field but it gives me an error.
I do this:
s = s.sort({'productForm': {"order": "desc"}})
I get the following error
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.')
I understand that fields need to be of the type keyword, so my mapping is like this
},
"productForm": {
"analyzer": "keyword",
"type": "text"
},
What am I missing to make this work
Thanks
Grant