title: SQL replace function with MATCH() AGAINST()
body: <p>I would like to use the <code>replace</code> function inside a <code>match</code> function, to remove <code>\n</code> characters before it searches matching rows. Otherwise, for example, if the text  is <strong>FULLTEXT\nsearch</strong>, and the search is <strong>search</strong>, it will not match.</p>
  
  <p>Here is my query (simplified) :</p>
  
  <pre><code>SELECT * FROM messages WHERE MATCH(REPLACE(body,'\\n',' ')) AGAINST ('mysearch' IN BOOLEAN MODE)
  </code></pre>
  
  <p>But it throws an error...
  <br/><br/></p>
  
  <h3>[EDIT]</h3>
  
  <p>After @Shadow 's answer, I tried this :</p>
  
  <pre><code>SELECT * FROM (SELECT REPLACE(body,'\\n',' ') AS rb FROM messages) AS rbody WHERE MATCH(rb) AGAINST ('mysearch');
  </code></pre>
  
  <p>I think the idea is correct, but I get an error <em>ERROR 1210 (HY000): Incorrect arguments to MATCH</em>. I think this is because I didn't index the column rb (<code>FULLTEXT INDEX (rb)</code>), so the <code>MATCH () AGAINST ()</code> operation won't work.</p>
  
  <p>So I update my question : <strong>How can one index a column of a subquery</strong></p>