Why _timestamp field is not returned with the format that we have set in the mapping?

Hi,
I want to make use of the _timestamp field to keep track the last indexed
datetime of an doc in ElasticSearch.
I have set the mapping as below:

  "mappings": {
     "_default_": {
        "_timestamp": {
           "enabled": true,
           "store": true,
           "format": "yyyy-MM-dd'T'HH:mm:ss.SSS"
        }

I have mentioned the _timestamp field with date format (as red font
highlighted). However, when I query the doc, the _timestamp field is still
showing as the unix format as below:

        "fields": {
           "_timestamp": 1427177681930
        }

Question

  1. I am using ElasticSearch version 1.32. Is this a bug?
  2. How can we get the _timestamp field with the correct format that we
    want? How to convert the _timestamp to a readable format? I use Sense to
    query.

Thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/68f60356-f3de-406b-890c-338e5cc31a64%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ES stores timestamps as unix epoch under the hood, however it will
translate that to UTC when you request it.

On 25 March 2015 at 15:47, Lee Chuen Ooi leechuen@gmail.com wrote:

Hi,
I want to make use of the _timestamp field to keep track the last indexed
datetime of an doc in Elasticsearch.
I have set the mapping as below:

  "mappings": {
     "_default_": {
        "_timestamp": {
           "enabled": true,
           "store": true,
           "format": "yyyy-MM-dd'T'HH:mm:ss.SSS"
        }

I have mentioned the _timestamp field with date format (as red font
highlighted). However, when I query the doc, the _timestamp field is still
showing as the unix format as below:

        "fields": {
           "_timestamp": 1427177681930
        }

Question

  1. I am using Elasticsearch version 1.32. Is this a bug?
  2. How can we get the _timestamp field with the correct format that we
    want? How to convert the _timestamp to a readable format? I use Sense to
    query.

Thanks.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/68f60356-f3de-406b-890c-338e5cc31a64%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/68f60356-f3de-406b-890c-338e5cc31a64%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAEYi1X9obvrsEqmk%3DOeqOkFtEQ9JedTMJ-8mUTA69id9Z5jtmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Mark,
Here is my query. The result returned is not in UTC, still in unix epoch.
Do you know why?

Query run in Sense:
GET _search?fields=_timestamp,_source
{
"query": { "match_all": {} }
}

Result:
"fields": {
"_timestamp": 1427177681930
}

On Wednesday, March 25, 2015 at 2:39:06 PM UTC+8, Mark Walkom wrote:

ES stores timestamps as unix epoch under the hood, however it will
translate that to UTC when you request it.

On 25 March 2015 at 15:47, Lee Chuen Ooi <leec...@gmail.com <javascript:>>
wrote:

Hi,
I want to make use of the _timestamp field to keep track the last indexed
datetime of an doc in Elasticsearch.
I have set the mapping as below:

  "mappings": {
     "_default_": {
        "_timestamp": {
           "enabled": true,
           "store": true,
           "format": "yyyy-MM-dd'T'HH:mm:ss.SSS"
        }

I have mentioned the _timestamp field with date format (as red font
highlighted). However, when I query the doc, the _timestamp field is still
showing as the unix format as below:

        "fields": {
           "_timestamp": 1427177681930
        }

Question

  1. I am using Elasticsearch version 1.32. Is this a bug?
  2. How can we get the _timestamp field with the correct format that we
    want? How to convert the _timestamp to a readable format? I use Sense to
    query.

Thanks.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/68f60356-f3de-406b-890c-338e5cc31a64%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/68f60356-f3de-406b-890c-338e5cc31a64%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8dc8a632-b7a6-499c-a299-e0abb2d2055d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.