Skip to content

type date in ES6-timestream cannot be sorted on

Query bellow returns error: {{{ curl -XGET -H 'Content-Type: application/json' 'http://cmsos-iaas-bril.cms:9200/bril-bestlumi/_search?pretty' -d '{ "query": { "match_all": {} }, "size": 1, "sort": [ { "timestamp": { "order": "desc" } } ] }' }}}

{{{ "Can't load fielddata on [timestamp] because fielddata is unsupported on fields of type [date]. Use doc values instead." }}}

The mapping for this field is: {{{ "timestamp" : { "type" : "date", "index" : false, "doc_values" : false, "format" : "yyyy-MM-dd'T'HH:mm:ss'Z'" } }}}

see http://cmsos-iaas-bril/flashweb/view_index.php?zone=bril&flashlist=bestlumi&indexname=bril-bestlumi_2018-11-20t08:55:00z_p1mt13m

We did simple test creating similar index with field of type data with the following mapping: {{{ "timestamp" : { "type" : "date", "index" : false, "doc_values" : true, "format" : "yyyy-MM-dd'T'HH:mm:ss'Z'" } }}}

The query works.

We need all the fields with data type to be sortable (essential for time series chart). Can we change "doc_values" to true for type date? Or any other suggestions to make date fields sortable?

thanks, Zhen&Jonas

Edited by Luciano Orsini
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information