Hi all.. thanks in advance...
I have what appears to be a date sorting issue.
I run the following _search query
{"fields":["publish_date"],"sort":[{"publish_date":
{"order":"desc"}}],"query":{"match_all":{}}}
I get back publish_date sorted by what looks like day..
{
took: 3
timed_out: false
_shards: {
total: 5
successful: 5
failed: 0
}
hits: {
total: 269
max_score: null
hits: [
{
_index: products
_type: xxxx
_id: 10-XXXX
_score: null
fields: {
publish_date: 2011-06-28 16:05:50 -0000
}
sort: [
1296230750000
]
}
{
_index: products
_type: xxxx
_id: 10-YYYY
_score: null
fields: {
publish_date: 2011-02-27 01:01:24 -0000
}
sort: [
1296090084000
]
}
{
_index: products
_type: xxxx
_id: 10-ZZZZ
_score: null
fields: {
publish_date: 2011-02-27 01:00:16 -0000
}
sort: [
1296090016000
]
}
{
_index: products
_type: xxxx
_id: 10-AAAA
_score: null
fields: {
publish_date: 2011-02-27 00:58:48 -0000
}
sort: [
1296089928000
]
},
{
_index: products
_type: xxxx
_id: 10-CCCC
_score: null
fields: {
publish_date: 2011-07-21 22:20:35 -0000
}
sort: [
1295648435000
]
}
... and so on.
my mapping looks like:
publish_date: {
format: "yyyy-mm-dd HH:mm:ss Z"
type: "date"
}
I load the data via _bulk
inside the bulk import (JSON) file.. the publish_date looks like:
,"publish_date":"2011-07-21 22:20:35 -0000",
what could be going wrong?