"The date type is a special type which maps to JSON string type. It follows
a specific format that can be explicitly set. All dates are UTC.
Internally, a date maps to a number type long, with the added parsing stage
from string to long and from long to string." (emphasis mine)
It sounds like dates are stored as type 'long'. But when I POST documents
with dates and then retrieve them, they are returned in the same format as
I POSTed them. So it appears ES is storing how I POSTed each date
somewhere.
I have a reproducible curl example demonstrating my confusion in more
detail on Stackoverflow here:
"The date type is a special type which maps to JSON string type. It
follows a specific format that can be explicitly set. All dates are UTC.
Internally, a date maps to a number type long, with the added parsing stage
from string to long and from long to string." (emphasis mine)
It sounds like dates are stored as type 'long'. But when I POST documents
with dates and then retrieve them, they are returned in the same format as
I POSTed them. So it appears ES is storing how I POSTed each date
somewhere.
I have a reproducible curl example demonstrating my confusion in more
detail on Stackoverflow here:
"The date type is a special type which maps to JSON string type. It
follows a specific format that can be explicitly set. All dates are
UTC. Internally, a date maps to a number type long, with the added parsing
stage from string to long and from long to string." (emphasis mine)
It sounds like dates are stored as type 'long'. But when I POST documents
with dates and then retrieve them, they are returned in the same format as
I POSTed them. So it appears ES is storing how I POSTed each date
somewhere.
I have a reproducible curl example demonstrating my confusion in more
detail on Stackoverflow here:
Well, the company won't edit his source anyway (but I get your point,
I'm used to refer to Elasticsearch as Elastic, I have to fix it)
I think his question is: he posts a document with a date in string format
and retrieve it in the same format. He was expecting to retrieve it as long
type since it is the type Elasticsearch uses internally.
I'm not familiar with the internal code of Elasticsearch, but as far as I
know, it won't change the source during indexing. It probably uses long
type in the index, but when you retrieve the source, you retrieve the
exactly source you posted
"The date type is a special type which maps to JSON string type. It
follows a specific format that can be explicitly set. All dates are
UTC. Internally, a date maps to a number type long, with the added parsing
stage from string to long and from long to string." (emphasis mine)
It sounds like dates are stored as type 'long'. But when I POST
documents with dates and then retrieve them, they are returned in the same
format as I POSTed them. So it appears ES is storing how I POSTed each date
somewhere.
I have a reproducible curl example demonstrating my confusion in more
detail on Stackoverflow here:
Ah ok, we convert between these formats so it's completely transparent to
the end user and easier to store under the hood.
On 20 March 2015 at 12:39, Roger de Cordova Farias <
roger.farias@fontec.inf.br> wrote:
Well, the company won't edit his source anyway (but I get your point,
I'm used to refer to Elasticsearch as Elastic, I have to fix it)
I think his question is: he posts a document with a date in string format
and retrieve it in the same format. He was expecting to retrieve it as long
type since it is the type Elasticsearch uses internally.
I'm not familiar with the internal code of Elasticsearch, but as far as I
know, it won't change the source during indexing. It probably uses long
type in the index, but when you retrieve the source, you retrieve the
exactly source you posted
"The date type is a special type which maps to JSON string type. It
follows a specific format that can be explicitly set. All dates are
UTC. Internally, a date maps to a number type long, with the added parsing
stage from string to long and from long to string." (emphasis mine)
It sounds like dates are stored as type 'long'. But when I POST
documents with dates and then retrieve them, they are returned in the same
format as I POSTed them. So it appears ES is storing how I POSTed each date
somewhere.
I have a reproducible curl example demonstrating my confusion in more
detail on Stackoverflow here:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.