title: How to use Lucene to query a CSV field
body: <p>We're using Umbraco which has a built in search system built on Lucene. </p>
  
  <p>Each document on the website contains a list of tags, these are indexed and held by Luence as a single field containing the tags in CSV format.</p>
  
  <p>For example:</p>
  
  <pre><code>Red,Green,Blue
  </code></pre>
  
  <p>However when we search against this field through Umbraco (also using <a href="http://www.getopt.org/luke/" rel="nofollow">Luke</a>) we don't get the correct behaviour.</p>
  
  <p><strong>Searching for 'Red' works, however a search for 'Green' or 'Blue' doesn't.</strong></p>
  
  <p>From my understanding of Lucene this is all down to <strong>the analyser not understanding the CSV format</strong>. The analyser needs to tokenise using the comma to break into tokens.</p>
  
  <p>However I'm at a loss at how to achieve this.</p>
  
  <p>It seems like it must a common problem, so I must be missing something very obvious.</p>