Display results based on first word/result matched

Hi,

If I am sending the query: One Two

With record One and record Two

I am getting the results ordered like this…

  1. Two
  2. One

How can I get Alogila to return the first word in a search query as the first result? Therefore showing the first matched word as the first result and the second matched word as the second result?

I do not want to sort alphabetically I want to sort by the first word in the search query.

Therefore if I send the query: One Two

I want the results:

  1. One
  2. Two

and if I send the query: Two One

I want the results:

  1. Two
  2. One

Many thanks for any suggestions.