title: Mysql - "Best Match" search algorithm
body: <p>Let's assume I have a table full of <strong>teachers</strong>.</p>
  
  <p>every teacher has these <strong>parameters</strong>:</p>
  
  <pre><code>Experience
  Hourly Cost
  Distance
  Last Login
  Total Rating (like an eBay score given by student)
  </code></pre>
  
  <p>the fact is, that I would avoid to give my users those dropdown menus to choose the sorting option, but i would build a search engine smart enough to compute the <strong>best match</strong></p>
  
  <p>for best match i mean a good balance of each parameter, so the first results are the teachers who have a recent login, who are closer to you etc...but not necesserely alwasy with the same sorting sequence (login DESC, THEN distance ASc etc...)</p>
  
  <p>example:
  i set as first parameter of sorting the lastlogin DESC.
  how to avoid that a teacher (with alow score and faraway from me) that Sign in every day is going to be always first in my results, and maybe a teacher that is only 1mile form me, but he sign in only once a week is going to be penalized for that...</p>
  
  <p>i hope i was clear.. ;)</p>