Pulling my hair out on this one...
Using ES 2.3
Trying to sort results based on a unix epoch field, but results are being returned in the wrong order... however, they are being sorted (you can reverse the order and get the incorrect results in the reverse order)
E.g, search returns three results
last_action: 1472228572 (181 days ago)
last_action: 1471424370 (190 days ago)
last_action: 1473689679 (164 days ago)
Changing the order to ascending we get
last_action: 1473689679 (164 days ago)
last_action: 1471424370 (190 days ago)
last_action: 1472228572 (181 days ago)
Sort is:
$query['sort'] = [
'last_action' => [
'order' => 'desc',
],
];
Mapping for this field is:
'last_action' => [
'type' => 'date',
'format' => 'epoch_second',
'index' => 'analyzed',
'store' => 'yes'
]
Any idea what could be throwing this off?
There are no exceptions being thrown by the server during storage or mapping...
Marcus