title: Postgresql prefix wildcard for full text
body: <p>I am trying to run a fulltext query using Postgresql that can cater for partial matches using wildcards.</p>
  
  <p>It seems easy enough to have a postfix wildcard after the search term, however I cannot figure out how to specify a prefix wildcard.</p>
  
  <p>For example, I can perform a postfix search easily enough using something like..</p>
  
  <pre><code>SELECT "t1".* 
  FROM "t1" 
  WHERE (to_tsvector('simple', "t1"."city") @@ to_tsquery('simple', 'don:*') )
  </code></pre>
  
  <p>should return results matching "London"</p>
  
  <p>However I cant seem to do a prefix search like...</p>
  
  <pre><code>SELECT "t1".* 
  FROM "t1" 
  WHERE (to_tsvector('simple', "t1"."city") @@ to_tsquery('simple', ':*don') )
  </code></pre>
  
  <p>Ideally I'd like to have a wildcard prefixed to the front and end of the search term, something like...</p>
  
  <pre><code>SELECT "t1".* 
  FROM "t1" 
  WHERE (to_tsvector('simple', "t1"."city") @@ to_tsquery('simple', ':*don:*') )
  </code></pre>
  
  <p>I can use a LIKE condition however I was hoping to benefit from the performance of the full text search features in Postgres.</p>