 <p>Well, it turned out to be simpler than I thought. I decided to read the code of the plugin and modify it by commenting out the code that sorts my output.</p> <p>That is when I found a variable 'sortResults:true' in defaults. So, all I needed was to set that variable to false. I didn't find this in the documentation though.</p> <p><code>$('#search').autocomplete ( { url: "index.php", sortResults: false } )</code></p> <p>Now the output is in the exact order that I require.</p> <p>I got the idea of reading the code to find/solve the problem from here : <a href="http://stackoverflow.com/questions/2594297/jquery-autocomplete-plugin-is-messing-up-the-order-of-my-data">jQuery &quot;Autocomplete&quot; plugin is messing up the order of my data</a> (That isn't the same plugin)</p> <p>Thanks. :) </p>