Giving wrong Sorting order

I am applying multiple sorting, on code, city and then name.The codes are:

AK
AL
AR
AZ
BH
...................
ZK

So expected result is that the document with AK should come first, then AL,
then AR AND then AZ and so on...

but the sorting order is AL,AK,AZ,AR....
can you tell me the reason? does sorting work only on first alphabet??

Hi Narinder

So expected result is that the document with AK should come first,
then AL, then AR AND then AZ and so on...

but the sorting order is AL,AK,AZ,AR....
can you tell me the reason? does sorting work only on first alphabet??

This should work. Please gist a complete example demonstrating the
issue. See Elasticsearch Platform — Find real-time answers at scale | Elastic for a guide to gisting
examples.

clint