title: How to show excerpts from pg-search multisearch results
body: <p>I've set up pg_search in my Rails app on Heroku:</p>
  
  <pre><code>@query = 'fast'
  PgSearch.multisearch(@query) #=&gt;
  [#&lt;PgSearch::Document searchable: ferrari, :content: 'this car is really fast'&gt;,
   #&lt;PgSearch::Document searchable: viper, :content: 'a very fast car'&gt;]
  </code></pre>
  
  <p>I'd like to display these results with excerpts from <code>content</code> to show where the match occurs. I can call <code>excerpt(content, @query)</code> to get exactly what I want when <code>@query</code> is only one word, but <code>excerpt()</code> only handles exact matches, so if:</p>
  
  <pre><code>@query = 'car fast'
  PgSearch.multisearch(@query) #=&gt;
  [#&lt;PgSearch::Document searchable: ferrari, :content: 'this car is really fast'&gt;,
   #&lt;PgSearch::Document searchable: viper, :content: 'a very fast car'&gt;]
  </code></pre>
  
  <p>then <code>excerpt(content, @query)</code> is nil because nowhere in <code>content</code> does the exact phrase 'car fast' appear.</p>
  
  <p>I considered <code>excerpt(content, @query.split(' ').first)</code> to at least show <em>something</em> for multi-word queries, but there are still cases such as this:</p>
  
  <pre><code>@query = 'car?'
  @results = PgSearch.multisearch(@query) #=&gt;
  [#&lt;PgSearch::Document searchable: ferrari, :content: 'this car is really fast'&gt;,
   #&lt;PgSearch::Document searchable: viper, :content: 'a very fast car'&gt;]
  excerpt(@results.first.content, @query) #=&gt; nil
  </code></pre>
  
  <p>So, how do folks show excerpts from search results when using pg_search?</p>