title: Solr spellCheck type with facets throws Exception during facet.field: spell
body: <p>I have a problem with faceting of spell field that is of type spellCheck. I am getting an exception <code>Exception during facet.field: spell</code> and I am not sure if it is actually possible to facet this field.</p>
  
  <p>Solr version: 6.6.5</p>
  
  <p>Request header:</p>
  
  <pre><code>GET /solr/core_de/select?facet.field=spell&amp;facet=on&amp;indent=on&amp;q=*:*&amp;wt=json HTTP/1.1
  Host: xxxx:8983
  Connection: keep-alive
  Pragma: no-cache
  Cache-Control: no-cache
  Upgrade-Insecure-Requests: 1
  User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
  Accept-Encoding: gzip, deflate
  Accept-Language: en-US,en;q=0.9
  </code></pre>
  
  <p>Solr request handler:</p>
  
  <pre><code>&lt;requestHandler name="/select" class="solr.SearchHandler"&gt;
      &lt;lst name="defaults"&gt;
          &lt;str name="defType"&gt;edismax&lt;/str&gt;
          &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
          &lt;str name="qf"&gt;content^40.0 title^5.0 keywords^2.0 tagsH1^5.0 tagsH2H3^3.0 tagsH4H5H6^2.0 tagsInline^1.0&lt;/str&gt;
          &lt;str name="pf"&gt;content^2.0&lt;/str&gt;
          &lt;str name="df"&gt;content&lt;/str&gt;
          &lt;int name="ps"&gt;15&lt;/int&gt;
  
          &lt;str name="mm"&gt;2&amp;lt;-35%&lt;/str&gt;
          &lt;str name="mm.autoRelax"&gt;true&lt;/str&gt;
  
          &lt;str name="hl.fl"&gt;title,content&lt;/str&gt;
          &lt;int name="hl.snippets"&gt;3&lt;/int&gt;
          &lt;str name="hl.mergeContiguous"&gt;true&lt;/str&gt;
          &lt;str name="hl.requireFieldMatch"&gt;true&lt;/str&gt;
  
          &lt;str name="f.content.hl.alternateField"&gt;content&lt;/str&gt;
          &lt;str name="f.content.hl.maxAlternateFieldLength"&gt;200&lt;/str&gt;
  
          &lt;str name="spellcheck"&gt;false&lt;/str&gt;
          &lt;str name="spellcheck.onlyMorePopular"&gt;false&lt;/str&gt;
          &lt;str name="spellcheck.extendedResults"&gt;false&lt;/str&gt;
          &lt;str name="spellcheck.count"&gt;1&lt;/str&gt;
          &lt;str name="spellcheck.dictionary"&gt;default&lt;/str&gt;
          &lt;str name="spellcheck.dictionary"&gt;wordbreak&lt;/str&gt;
  
          &lt;str name="wt"&gt;json&lt;/str&gt;
          &lt;str name="indent"&gt;true&lt;/str&gt;
      &lt;/lst&gt;
  
      &lt;arr name="last-components"&gt;
          &lt;str&gt;spellcheck&lt;/str&gt;
          &lt;str&gt;elevator&lt;/str&gt;
      &lt;/arr&gt;
  &lt;/requestHandler&gt;
  </code></pre>
  
  <p>spellcheck searchComponent in solrconfig.xml</p>
  
  <pre><code>&lt;searchComponent name="spellcheck" class="solr.SpellCheckComponent"&gt;
      &lt;str name="queryAnalyzerFieldType"&gt;textSpell&lt;/str&gt;
  
      &lt;lst name="spellchecker"&gt;
          &lt;str name="name"&gt;default&lt;/str&gt;
          &lt;str name="field"&gt;spell&lt;/str&gt;
          &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
          &lt;str name="distanceMeasure"&gt;internal&lt;/str&gt;
          &lt;float name="accuracy"&gt;0.5&lt;/float&gt;
          &lt;int name="maxEdits"&gt;2&lt;/int&gt;
          &lt;int name="minPrefix"&gt;1&lt;/int&gt;
          &lt;int name="maxInspections"&gt;5&lt;/int&gt;
          &lt;int name="minQueryLength"&gt;3&lt;/int&gt;
          &lt;float name="maxQueryFrequency"&gt;0.01&lt;/float&gt;
      &lt;/lst&gt;
  
      &lt;!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage --&gt;
      &lt;lst name="spellchecker"&gt;
          &lt;str name="name"&gt;wordbreak&lt;/str&gt;
          &lt;str name="classname"&gt;solr.WordBreakSolrSpellChecker&lt;/str&gt;
          &lt;str name="field"&gt;spell&lt;/str&gt;
      &lt;/lst&gt;
  &lt;/searchComponent&gt;
  </code></pre>
  
  <p>Field definition in general_schema_fields.xml</p>
  
  <pre><code>&lt;field name="spell" type="textSpell" indexed="true" stored="false" multiValued="true" /&gt;
  &lt;copyField source="title"    dest="spell" /&gt;
  &lt;copyField source="subTitle" dest="spell" /&gt;
  &lt;copyField source="content"  dest="spell" /&gt;
  </code></pre>
  
  <p>From the solr source code, the process throws an exception at:</p>
  
  <p><a href="https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.6.5/solr/core/src/java/org/apache/solr/request/SimpleFacets.java#L809" rel="nofollow noreferrer">https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.6.5/solr/core/src/java/org/apache/solr/request/SimpleFacets.java#L809</a></p>
  
  <p>First few lines of the exception:</p>
  
  <pre><code>org.apache.solr.common.SolrException: Exception during facet.field: spell
  tat org.apache.solr.request.SimpleFacets.lambda$getFacetFieldCounts$0(SimpleFacets.java:809)
  tat java.util.concurrent.FutureTask.run(FutureTask.java:266)
  tat org.apache.solr.request.SimpleFacets$3.execute(SimpleFacets.java:742)
  tat org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:818)
  tat org.apache.solr.handler.component.FacetComponent.getFacetCounts(FacetComponent.java:330)
  tat org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:274)
  tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:296)
  tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
  tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
  tat org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
  tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
  tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
  tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
  tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
  tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
  tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
  </code></pre>
  
  <p>Faceting over fields like title works without problems.</p>
  
  <p>How can I make it work?</p>
  
  <p>Thanks.</p>