I found my problem on the UI side (thanks to @CBroe) where by ajax response was being exposed to a jQuery library DataTable()
, whose default ordering was sorting in alphabetical order. I set the ordering parameter to false as:
$("#someid").DataTable({"ordering":false});
And My results were displayed as I was willing to