title: How can I manipulate MySQL fulltext search relevance to make one field more 'valuable' than another?
body: <p>Suppose I have two columns, keywords and content. I have a fulltext index across both. I want a row with foo in the keywords to have more relevance than a row with foo in the content. What do I need to do to cause MySQL to weight the matches in keywords higher than those in content? </p>
  
  <p>I'm using the "match against" syntax. </p>
  
  <p>SOLUTION:</p>
  
  <p>Was able to make this work in the following manner: </p>
  
  <pre><code>SELECT *, 
  CASE when Keywords like '%watermelon%' then 1 else 0 END as keywordmatch, 
  CASE when Content like '%watermelon%' then 1 else 0 END as contentmatch,
  MATCH (Title, Keywords, Content) AGAINST ('watermelon') AS relevance 
  FROM about_data  
  WHERE MATCH(Title, Keywords, Content) AGAINST ('watermelon' IN BOOLEAN MODE) 
  HAVING relevance &gt; 0  
  ORDER by keywordmatch desc, contentmatch desc, relevance desc 
  </code></pre>