title: Rails - Postgresql - Full text search - Railscasts 343
body: <p>I'm following the Railscasts #343 Full-Text Search in PostgreSQL, and at the beggining I get a problem.</p>
  
  <p>I replace this line in my modele :</p>
  
  <pre><code>where("name ilike :q or content ilike :q", q: "%#{query}%")
  </code></pre>
  
  <p>by</p>
  
  <pre><code>where("name @@ :q or content @@ :q", q: query)
  </code></pre>
  
  <p>But, it still don't perform the search as he can in the railscasts. If in the name I have "FOO", and in the content "BAR", and if I search "FOO BAR" the result is empty. (Like with the old code and the "ilike" function)</p>
  
  <p>The SQL request look like that :</p>
  
  <pre><code>* FROM "posts" where (name @@ 'foo bar' or content @@ 'foo bar')
  </code></pre>
  
  <p>I'm using PostgreSQL 9.2.2 , Rails 3.2.6 and Ruby 1.9.3p125 on Windows 7 x64.</p>
  
  <p>Thanks by advance.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My Gem file :</p>
  
  <pre><code>    source 'https://rubygems.org'
  
  gem 'rails', '3.2.6'
  
  gem 'pg'
  gem "ransack"
  
  
  group :assets do
    gem 'sass-rails',   '~&gt; 3.2.3'
    gem 'coffee-rails', '~&gt; 3.2.1'
  
  
    gem 'uglifier', '&gt;= 1.0.3'
  end
  
  gem 'jquery-rails'
  </code></pre>
  
  <p>I removed all commented line.</p>
  
  <p>PS: Just to be clear, before I add "ransack", I had the same problem.</p>