Can't get sorting working on date and geo_location

this is my mapping
"test" : {
"properties" : {
"model" : {
"index" : "not_analyzed",
"type" : "string"
},
"expires" : {
"null_value" : "-1",
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
},
"location" : {
"type" : "geo_point"
},
"subject" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"class" : {
"index" : "not_analyzed",
"type" : "string"
},
"date" : {
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
},
"cid" : {
"index" : "not_analyzed",
"type" : "string"
},
"country" : {
"index" : "not_analyzed",
"type" : "string"
}
}
}

sorting by _id works, but by date and expired I get the same results with asc and desc,
same with _geo_distance sort on location

any idea what I'm doing wrong?

gist a recreation.

On Wednesday, June 8, 2011 at 1:43 PM, xrado wrote:

this is my mapping
"test" : {
"properties" : {
"model" : {
"index" : "not_analyzed",
"type" : "string"
},
"expires" : {
"null_value" : "-1",
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
},
"location" : {
"type" : "geo_point"
},
"subject" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"class" : {
"index" : "not_analyzed",
"type" : "string"
},
"date" : {
"format" : "yyyy-MM-dd HH:mm:ss",
"type" : "date"
},
"cid" : {
"index" : "not_analyzed",
"type" : "string"
},
"country" : {
"index" : "not_analyzed",
"type" : "string"
}
}
}

sorting by _id works, but by date and expired I get the same results with
asc and desc,
same with _geo_distance sort on location

any idea what I'm doing wrong?

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3038561.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com (http://Nabble.com).

date sorting https://gist.github.com/1014273

(geo_distance started working)

Whats not working exactly in your gist? Things seem to work well for me, but you did not say what does not work... :slight_smile:

On Wednesday, June 8, 2011 at 2:48 PM, xrado wrote:

date sorting elasticsearch date sort · GitHub

(geo_distance started working)

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3038727.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com (http://Nabble.com).

try switching sorting order on date ("sort":{"date":"asc"}) or expires ( "sort":{"expires":"asc") asc/desc,
not sorting, returns the same result https://gist.github.com/1014273

Sorry just testing if I can reply to posts.

Hi,

I just tested on a 0.16.2 cluster, and for dates asc/desc, results are
the same, but it's normal, date values are the same in both docs
"2011-06-08 10:30:09", sort value: 1307529009000

For expires asc/desc, I have correct results, see
elasticsearch date sort · GitHub and sort values: -1 and
1307701809000

Ludo

On Wed, Jun 8, 2011 at 8:15 PM, xrado radovan.lozej@gmail.com wrote:

try switching sorting order on date ("sort":{"date":"asc"}) or expires (
"sort":{"expires":"asc") asc/desc,
not sorting, returns the same result elasticsearch date sort · GitHub

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/can-t-get-sorting-working-on-date-and-geo-location-tp3038561p3040193.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

i guess then is my messy data, need to look closer, thx to all for now

  • deleted -