일래스틱서치에 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."




에러 관련해서 문서를 보면 먼가 작업을 해야 할 것 같지만..

https://www.elastic.co/guide/en/elasticsearch/reference/5.0/fielddata.html


uuid는 keyword라는 필드가 있어서.. 사용하면 작 동작한다.



 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" } 

          ]

}'





Posted by '김용환'
,