title: PostgreSQL: Full Text Search - How to search partial words?
body: <p>Following a question posted here about how I can increase the speed on one of my SQL Search methods, I was advised to update my table to make use of Full Text Search. This is what I have now done, using Gist indexes to make searching faster. On some of the "plain" queries I have noticed a marked increase which I am very happy about.</p>
  
  <p>However, I am having difficulty in searching for partial words. For example I have several records that contain the word Squire (454) and I have several records that contain Squirrel (173). Now if I search for Squire it only returns the 454 records but I also want it to return the Squirrel records as well.</p>
  
  <p>My query looks like this</p>
  
  <pre><code>SELECT title 
  FROM movies 
  WHERE vectors @@ to_tsoquery('squire');
  </code></pre>
  
  <p>I thought I could do <code>to_tsquery('squire%')</code> but that does not work.<br />
  How do I get it to search for partial matches ?</p>
  
  <p>Also, in my database I have records that are movies and others that are just TV Shows. These are differentiated by the "" over the name, so like "Munsters" is a TV Show, whereas The Munsters is the film of the show. What I want to be able to do is search for just the TV Show AND just the movies. Any idea on how I can achieve this ?</p>
  
  <p>Regards
  Anthoni</p>