title: Similarity search using Solr's NGramFilterFactory
body: <p>I am trying to use the NGramFilterFactory in Solr (using Sunspot in Rails) to find similar titles. I managed to add  a new field to my solr schema.xml like follows:</p>
  
  <pre><code>&lt;fieldType name="text_ngrm" class="solr.TextField" positionIncrementGap="100"&gt;
    &lt;analyzer type="index"&gt;
      &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;filter class="solr.NGramFilterFactory" minGramSize="2" maxGramSize="4"/&gt;
    &lt;/analyzer&gt;
    &lt;analyzer type="query"&gt;
      &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
    &lt;/analyzer&gt;
  &lt;/fieldType&gt;
  </code></pre>
  
  <p>As I am using sunpsot in a rails app and therefore added the new field through a dynamic field to sunspot. This all worked and I can now search my model using the NGramFilterFactory. What I am not sure about is, how to configure solr in order to search for similar titles. Here are my concrete questions:</p>
  
  <ol>
  <li>Does it make sense to use the dismax query parser when I am trying to query similar titles?</li>
  <li>How can the <a href="http://wiki.apache.org/solr/DisMaxQParserPlugin#mm_.28Minimum_.27Should.27_Match.29" rel="nofollow">(Minimum 'Should' Match)</a> parameter help me to find similar titles?</li>
  <li>Based on what exactly would I choose the ngram min. and max. sizes?</li>
  </ol>
  
  <p>Thanks for any feedback. </p>