Re: ES 1.2.1 sort by _timestamp

2014-06-13 Thread Stefan Eberl


On Friday, June 13, 2014 10:31:53 AM UTC+2, Itamar Syn-Hershko wrote:
>
> Possibly, because it's not provided in the _source, or just use this: 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html#_path_2
>
> So your suggestion is to have my app fill an additional field, which then 
gets's mapped to _timestamp, correct?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d68a20f4-8234-4bfc-b4ee-d135f948dda5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ES 1.2.1 sort by _timestamp

2014-06-13 Thread Stefan Eberl


On Thursday, June 12, 2014 6:52:16 PM UTC+2, Itamar Syn-Hershko wrote:
>
> This is weird. Are you sure what you are seeing is not overridden 
> documents (can happen if you specify the ID yourself)? Can you add the 
> _timestamp field to the results and verify the documents are indeed not 
> sorted by _timestamp?
>
The id is also automatically generated by ES.
Do i need to store the _timestamp field to be able to retrieve it  using   
"fields" : ["_timestamp"]  in my query?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c1190f3b-2707-4b1e-9151-5967a7a54733%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: ES 1.2.1 sort by _timestamp

2014-06-12 Thread Stefan Eberl


> Do you set timestamp value from you client or do you let ES fill them for 
> you?
>
I let ES fill that value.
 

> Do you run more than one node? Are the clocks on your nodes running 
> synchronously?
>
Only one node is storing data, the remaining nodes are client nodes only.
Clocks are synchronized with a time server.

BR,
Stefan

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/27edfe03-f8d7-4114-95dc-129b7b6e7bfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ES 1.2.1 sort by _timestamp

2014-06-12 Thread Stefan Eberl
Hey all,

I have a question regarding sorting by _timestamp.

The _timestamp "enabled" setting is set to true, everything else is not 
explicitly specified (so I assume default values are used).
I have an application inserting new documents periodically and I would 
assume that _timestamp gets filled with the current timestamp.

After a while I perform the following sort
curl -XPOST 'http://localhost:9200/my_index/my_type/_search?pretty' -d ' {
"sort" : [
{ "_timestamp" : {"order" : "desc" } }
]
}

I would expect to always get the last 10 inserted documents, which is not 
the case.
Sometimes I get the most recent ones, sometimes I get some historical data.

Thanks for your help.

BR,
Stefan


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/1d81d216-f393-4618-afb7-74d71aa7841c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.