title: MySQL match() against() - order by relevance and column?
body: <p>Okay, so I'm trying to make a full text search in multiple columns, something simple like this:</p>
  
  <pre><code>SELECT * FROM pages WHERE MATCH(head, body) AGAINST('some words' IN BOOLEAN MODE)
  </code></pre>
  
  <p>Now i want to order by relevance, (how many of the words are found?) which I have been able to do with something like this:</p>
  
  <pre><code>SELECT * , MATCH (head, body) AGAINST ('some words' IN BOOLEAN MODE) AS relevance 
  FROM pages
  WHERE MATCH (head, body) AGAINST ('some words' IN BOOLEAN MODE)
  ORDER BY relevance
  </code></pre>
  
  <p>Now here comes the part where I get lost, I want to prioritize the relevance in the <code>head</code> column.</p>
  
  <p>I guess I could make two relevance columns, one for <code>head</code> and one for <code>body</code>, but at that point I'd be doing somewhat the same search in the table three times, and for what i'm making this function, performance is important, since the query will both be joined and matched against other tables.</p>
  
  <p><strong>So, my main question is</strong>, is there a faster way to search for relevance and prioritize certain columns? (And as a bonus possibly even making relevance count number of times the words occur in the columns?)</p>
  
  <p>Any suggestions or advice would be great.</p>
  
  <p><strong>Note:</strong> I will be running this on a LAMP-server. (WAMP in local testing)</p>