[elasticsearch6] uuid-Fielddata is disabled on text fields by default 에러 해결하기
일래스틱서치에 uuid로 소팅하고 싶은데, 에러가 발생했다.
(쿼리)
curl -XGET 'localhost:9200/google_plus_data/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": { "match_all": {} },
"size": 10,
"sort": [
{ "@timestamp": "desc" } ,
{ "_uuid": "asc" }
]
}'
(에러)
"reason" : "Fielddata is disabled on text fields by default. Set fielddata=true on [_uuid] 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."
curl -XGET 'localhost:9200/google_plus_data/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": { "match_all": {} },
"size": 10,
"sort": [
{ "@timestamp": "desc" } ,
{ "_uuid.keyword": "asc" }
]
}'