Issues with timestamp sorting


(Chetana) #1

I have created a timestamp field (not be confused with _timestamp) and want
to sort timestamp field in descending order. But the result contains some
records out of order.

Mapping and the sorting criteria look like :
"timestamp":{"type"
:"date","format":"dateOptionalTime","include_in_all":false}

SearchRequestBuilder.addSort("timestamp", SortOrder.DESC);

The result I get is :

2013-12-26T09:14:09.617Z
,2013-12-26T12:01:07.389Z,2013-12-26T12:00:20.126Z,2013-12-26T11:59:15.594Z,2013-12-26T11:58:00.083Z,2013-12-26T11:55:52.372Z

Is it because of dateOptionalTime format or am I missing something?

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/6616a823-4421-4dbe-a440-a14fdce07e18%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Alexander Reelsen) #2

Hey,

can you create a reproducible gist for this (it is hard to help with so few
information)? Also, are you sure the mapping is applied correctly?

--Alex

On Thu, Jan 9, 2014 at 11:22 AM, Chetana ambha.career@gmail.com wrote:

I have created a timestamp field (not be confused with _timestamp) and
want to sort timestamp field in descending order. But the result contains
some records out of order.

Mapping and the sorting criteria look like :
"timestamp":{"type"
:"date","format":"dateOptionalTime","include_in_all":false}

SearchRequestBuilder.addSort("timestamp", SortOrder.DESC);

The result I get is :

2013-12-26T09:14:09.617Z
,2013-12-26T12:01:07.389Z,2013-12-26T12:00:20.126Z,2013-12-26T11:59:15.594Z,2013-12-26T11:58:00.083Z,2013-12-26T11:55:52.372Z

Is it because of dateOptionalTime format or am I missing something?

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/6616a823-4421-4dbe-a440-a14fdce07e18%40googlegroups.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8HQEFN_DR8Y5EDiDKsiJJ1aHsuwhKwEQbiVGBA63FHPg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3