title: Solr dismax behaviour - punctuation and white space splitting
body: <p>I have a Solr 4.7.0 instance, with 200 000 documents in the index (one document per file on a filesystem), used by several users. Documents are identified by keywords, that are indexed and stored in one field called "signature_1".
  During the index, I remove all type of punctuation that I replace with white space (thanks to a ScriptUpdateProcessor), so my keywords are separated with white spaces, both in the index and stored part of the field signature_1 (fieldtype signature).</p>
  
  <pre><code>&lt;fieldType name="signature" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"&gt;
    &lt;analyzer type="index"&gt;
      &lt;charFilter class="solr.PatternReplaceCharFilterFactory" pattern="([^a-zA-Z0-9éèàùêâûôîäëöüï])" replacement=" "/&gt;
      &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
      &lt;filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="1000" consumeAllTokens="false"/&gt;
      &lt;filter class="solr.ASCIIFoldingFilterFactory"/&gt;
      &lt;!--&lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="lang\stopwords_fr.txt" enablePositionIncrements="true" /&gt;--&gt;
      &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms_chantiers.txt" ignoreCase="true" expand="false"/&gt;
      &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms_chantiers_secteurs.txt" ignoreCase="true" expand="false"/&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;filter class="solr.SnowballPorterFilterFactory" language="French" /&gt;
    &lt;/analyzer&gt;
    &lt;analyzer type="query"&gt;
      &lt;charFilter class="solr.PatternReplaceCharFilterFactory" pattern="([^a-zA-Z0-9éèàùêâûôîäëöüï])" replacement=" "/&gt;
      &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt;
      &lt;filter class="solr.ASCIIFoldingFilterFactory"/&gt;
      &lt;!--&lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="lang\stopwords_fr.txt" enablePositionIncrements="true" /&gt;--&gt;
      &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms_chantiers.txt" ignoreCase="true" expand="false"/&gt;
      &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;filter class="solr.SnowballPorterFilterFactory" language="French" /&gt;
    &lt;/analyzer&gt;
  &lt;/fieldType&gt;
  </code></pre>
  
  <p>I would like the same behaviour during the query time : if somebody search for</p>
  
  <blockquote>
    <p>A-B-C</p>
  </blockquote>
  
  <p>I would like Solr to do the following search (with an OR operator, dismax) :</p>
  
  <blockquote>
    <p>A B C</p>
  </blockquote>
  
  <p>So basically, I simply want Solr to search between document's keywords, punctuation beeing removed.</p>
  
  <p>The upper example is working well, but in some case it's not working this way. With a query of</p>
  
  <blockquote>
    <p>A B-C</p>
  </blockquote>
  
  <p>Dismax splits the query in</p>
  
  <blockquote>
    <p>(+(DisjunctionMaxQuery((signature_1:a)) DisjunctionMaxQuery((signature_1:"b c"))) ())/no_coord</p>
  </blockquote>
  
  <p>and this messes up the relevancy (i.e. the order) of my results. I tried using autoGeneratePhraseQueries="True" but without effect.</p>
  
  <p>So I would like Dismax to always split on whitespace AND punctuation or never do it (results will be the same). Any idea how I can manage to do this (without having to create my Java Dismax class) ?</p>
  
  <p>The following posts are related to my problem :</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/15314460/solr-generates-phrase-queries-on-punctuation">SOLR generates phrase queries on punctuation</a></li>
  <li><a href="https://stackoverflow.com/questions/7887820/solr-dismax-handler-whitespace-and-special-character-behaviour">Solr Dismax handler - whitespace and special character behaviour</a></li>
  </ul>