title: Multi Keyword search on multi-column sql
body: <p>I try to make a multi-keyword search on my website.</p>
  
  <p>I want to find every post who contains A AND B.</p>
  
  <p>For example if I search "<strong>A</strong> <strong>B</strong>"</p>
  
  <p>I should find these post:</p>
  
  <blockquote>
    <p>Title: <strong>A</strong>cd <strong>B</strong>afd<br>
    Content: zzzzzz</p>
  </blockquote>
  
  <p>And also this one </p>
  
  <blockquote>
    <p>Title: ddddd </p>
    
    <p>Content: <strong>A</strong>ttt<strong>B</strong>cccd</p>
  </blockquote>
  
  <p>But not this one</p>
  
  <blockquote>
    <p>Title: <strong>A</strong>ttttt</p>
    
    <p>Content: <strong>B</strong>wwwww</p>
  </blockquote>
  
  <p>Because the title or the content doesn't have all the keyword I'm looking for.</p>
  
  <p>For now I have made this request which is working</p>
  
  <pre><code>keys = params[:search].split(' ')
  Article.where((["title LIKE ? OR content LIKE ?"] * keys.size).join(' AND '), *(keys.map { |key| ["%#{key}%", "%#{key}%"] }.flatten)).where(activate: true).order(created_at: :desc)
  </code></pre>
  
  <p>But the AND is acting same with a OR. It show me the 3 examples I gave.</p>
  
  <p>Do you think I should separate it in two request ?</p>
  
  <p>RAILS 5.2</p>