Autocomplete-Display suggested items starting with query character first instead of items which contains the query character

Autocomplete-Display suggested items starting with query character first instead of items which contains the query character

consider data source:{asp, java,pearl}; By default if user enters 'a' suggestions are shown in this order-java,pearl,asp.  Instead I want the suggestions to be displayed in the following order: asp,java,pearl.