I am following the operation of the video "getting started with Elasticsearch", https://www.elastic.co/webinars/getting-started-elasticsearch.
I post several indices into the Elasticsearch by using POST /inspections/_doc/_bulk, the documents of the indices include "inspection_score": 96 . But when I use the following command to sort the documents according to the value of "inspection_score", just as the video does.
GET /inspections/_doc/_search
{
"query":{
"range": {
"inspection_score": {
"gte": 80
}
}
},
"sort":[
{
"inspection_score": "desc"
}
]
}
I got the error: "Fielddata is disabled on text fields by default. Set fielddata=true on [inspection_score] in order to load fielddata in memory by uninverting the inverted index.
Why? The video shows everything is fine. By the way, is "inspection_score" of type text? I think it maybe number since in the POST command, I specify a number to the value of "inspection_score".