Scoring based on Term Position

Hi,

I have used autocomplete to display records matched to input .

it gives me the list of records which has matching words any where in the record.

But i want those records to appear first in which the position of matched words are in starting of the record.

Like i have searched Ram Nagar.

it gives me result like

OM SAI RAM, RP Nagar
RAM Nagar, Wadla Village, RAM Nagar

i want second result to be appear before first because i searched Ram nagar term whose position in the record 2nd comes earlier than first record.

I have used EdgeNGram analyzer.

Thanks in Advance.