 <p>Use a separate query analyzer with the KeywordTokenizerFactory, thus (using your example):</p> <pre><code> &lt;analyzer type="index"&gt; &lt;tokenizer class="solr.LowerCaseTokenizerFactory"/&gt; &lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="false" /&gt; &lt;filter class="solr.ShingleFilterFactory" maxShingleSize="5" outputUnigrams="false"/&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; &lt;analyzer type="query"&gt; &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt; &lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="false" /&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; </code></pre>