title: SOLR exact search turn off stemming
body: <p>I am using SOLR 4.10 core, and I have a field called PolicyReference with an IDX_PolicyReference index, and I am trying to set up an exact search on this field</p>
  
  <p>So I execute a query like the following: </p>
  
  <pre><code>IDX_PolicyReference:ABC123
  </code></pre>
  
  <p>This has been working fine for years.</p>
  
  <p>Now devs are sending PolicyReference values that contain a space: for example </p>
  
  <pre><code>IDX_PolicyReference:AB 123
  </code></pre>
  
  <p>This does not return the exact search result I am expecting.</p>
  
  <p>From reading other questions on SO regarding this, it sounds like I need to turn off stemming. </p>
  
  <p>I can successfully find the PolicyReference if I put double quotes around the value</p>
  
  <pre><code>IDX_PolicyReference:"AB 123"
  </code></pre>
  
  <p>But I'm trying to solve this without having to change the app that calls SOLR.</p>
  
  <p>The schema.xml has the following elements in it.</p>
  
  <pre><code>&lt;field name="PolicyReference" type="string" indexed="false" stored="true"/&gt;
  &lt;copyField source="PolicyReference" dest="IDX_PolicyReference"/&gt;
  &lt;field name="IDX_PolicyReference" type="text_Exact" indexed="true" stored="false" multiValued="true" /&gt;
  
  &lt;fieldType name="text_Exact" class="solr.TextField" positionIncrementGap="100" &gt;
      &lt;analyzer type="index"&gt;
          &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt;
          &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;/analyzer&gt;
      &lt;analyzer type="query"&gt;
          &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt;
          &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
      &lt;/analyzer&gt;
  &lt;/fieldType&gt;
  </code></pre>
  
  <p>My understanding was that when using KeywordTokenizerFactory, it takes the search term as one keyword. But it seems like space breaks it.</p>
  
  <p>Is there another tokenizerfactory that I can use to achieve what I'm trying? Are there other attributes I can apply to the tokenizer xml element, or a filter that I can add that will turn off the stemming for this field - something that I can change in schema.xml and reindex that will allow my search request to work as is? </p>
  
  <p>Again, I'm trying to avoid changing the app that calls SOLR.</p>