Where is the timestamp or where is the problem on my mapping definition "_timestamp"?


(pablo3027) #1

I define a new mapping to try this option... but the timestamp its not
saved atomatically with the post of the document

My mapping definition :

curl -XPUT "http://localhost:9200/indice/tweet/_mapping" -d'
{
"tweet": {
"properties": {
"message": {
"type": "string"
},
"user": {
"type": "string"
},
"post_date": {
"type": "date"
}
},
"_timestamp" :
{
"enabled":true,
"store": "yes",
"path" : "post_date",
"format" : "yyyy-MM-dd HH:mm:ss"
}
}
}'


When i store a document i supose that this timestamp its going to be stored
with the elasticsearch server date-time

curl -XPUT "http://localhost:9200/indice/tweet/1" -d'
{
"tweet":
{
"message" :"Prueba alta",
"user" : "Pablo"
}
}'

But nothing of this...... why????

curl -XGET "http://localhost:9200/indice/tweet/1"

{
"_index": "indice",
"_type": "tweet",
"_id": "1",
"_version": 5,
"exists": true,
"_source": {
"tweet": {
"message": "Prueba alta",
"user": "Pablo"
}
}
}

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.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #2

Elasticsearch never modifies your _source document.
That's the reason you don't have an updated document when you GET it.

But, you can search for it and as you stored the timestamp field, you probably can get it using field=_timestamp

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html

{
"fields" : ["_source", "_timestamp"]
}

Makes sense?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

12 novembre 2013 at 09:22:56, Pablo Blasco (pablo3027@gmail.com) a écrit:

I define a new mapping to try this option... but the timestamp its not saved atomatically with the post of the document

My mapping definition :

curl -XPUT "http://localhost:9200/indice/tweet/_mapping" -d'
{
"tweet": {
"properties": {
"message": {
"type": "string"
},
"user": {
"type": "string"
},
"post_date": {
"type": "date"
}
},
"_timestamp" :
{
"enabled":true,
"store": "yes",
"path" : "post_date",
"format" : "yyyy-MM-dd HH:mm:ss"
}
}
}'


When i store a document i supose that this timestamp its going to be stored with the elasticsearch server date-time

curl -XPUT "http://localhost:9200/indice/tweet/1" -d'
{
"tweet":
{
"message" :"Prueba alta",
"user" : "Pablo"
}
}'

But nothing of this...... why????

curl -XGET "http://localhost:9200/indice/tweet/1"

{
"_index": "indice",
"_type": "tweet",
"_id": "1",
"_version": 5,
"exists": true,
"_source": {
"tweet": {
"message": "Prueba alta",
"user": "Pablo"
}
}
}

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(pablo3027) #3

Great!! thanks

2013/11/12 David Pilato david@pilato.fr

Elasticsearch never modifies your _source document.
That's the reason you don't have an updated document when you GET it.

But, you can search for it and as you stored the timestamp field, you
probably can get it using field=_timestamp

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html

{
"fields" : ["_source", "_timestamp"]
}

Makes sense?

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

12 novembre 2013 at 09:22:56, Pablo Blasco (pablo3027@gmail.com//pablo3027@gmail.com)
a écrit:

I define a new mapping to try this option... but the timestamp its not
saved atomatically with the post of the document

My mapping definition :

curl -XPUT "http://localhost:9200/indice/tweet/_mapping" -d'
{
"tweet": {
"properties": {
"message": {
"type": "string"
},
"user": {
"type": "string"
},
"post_date": {
"type": "date"
}
},
"_timestamp" :
{
"enabled":true,
"store": "yes",
"path" : "post_date",
"format" : "yyyy-MM-dd HH:mm:ss"
}
}
}'


When i store a document i supose that this timestamp its going to be
stored with the elasticsearch server date-time

curl -XPUT "http://localhost:9200/indice/tweet/1" -d'
{
"tweet":
{
"message" :"Prueba alta",
"user" : "Pablo"
}
}'

But nothing of this...... why????

curl -XGET "http://localhost:9200/indice/tweet/1"

{
"_index": "indice",
"_type": "tweet",
"_id": "1",
"_version": 5,
"exists": true,
"_source": {
"tweet": {
"message": "Prueba alta",
"user": "Pablo"
}
}
}

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.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/bCCvDVBw6RU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
Saludos,
Pablo Blasco Martinavarro.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4