title: How to facet phrases in solr?
body: <p>Lately i have been trying to apply facet to a field with some values having multiple words(a phrase)? I have been suggested to use shingles but am not sure if that would work as expected as the required phrase should be taken from a given list.</p>
  
  <p>For example: when i apply facet to a field, i get seperate facets for 'Information' and 'Technology' whereas i want it to be a single facet like 'Information Technology'.</p>
  
  <p><strong>How to facet a particular phrase in a particular field?</strong></p>
  
  <p>EDIT:
  The schema for the required field looks like this:</p>
  
  <pre><code>&lt;fieldType name="text_en_splitting_tight" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true"&gt;
        &lt;analyzer&gt;
          &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
  
          &lt;filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_en.txt"/&gt;
          &lt;filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="1" catenateNumbers="1" catenateAll="0"/&gt;
          &lt;filter class="solr.LowerCaseFilterFactory"/&gt;
          &lt;filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/&gt;
  &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/&gt;
  &lt;filter class="solr.ShingleFilterFactory" maxShingleSize="2" outputUnigrams="true"/&gt;
  &lt;filter class="solr.EnglishMinimalStemFilterFactory"/&gt;
          &lt;!-- this filter can remove any duplicate tokens that appear at the same position - sometimes
               possible with WordDelimiterFilter in conjuncton with stemming. --&gt;
          &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt;
        &lt;/analyzer&gt;
        &lt;/fieldType&gt;
  </code></pre>
  
  <p>The shingles filter doesn't work, as it shows three facets for Information technology: information, technology and information technology.</p>