[ 
https://issues.apache.org/jira/browse/SOLR-7495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15230355#comment-15230355
 ] 

Matt Hilt commented on SOLR-7495:
---------------------------------

We had this problem using Solr 5.1 on an index that was *not sharded*. The 
fields in question did not have docValues set however.

> Unexpected docvalues type NUMERIC when grouping by a int facet
> --------------------------------------------------------------
>
>                 Key: SOLR-7495
>                 URL: https://issues.apache.org/jira/browse/SOLR-7495
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.0, 5.1, 5.2, 5.3
>            Reporter: Fabio Batista da Silva
>         Attachments: SOLR-7495.patch
>
>
> Hey All,
> After upgrading from solr 4.10 to 5.1 with solr could
> I'm getting a IllegalStateException when i try to facet a int field.
> IllegalStateException: unexpected docvalues type NUMERIC for field 'year' 
> (expected=SORTED). Use UninvertingReader or index with docvalues.
> schema.xml
> {code}
> <?xml version="1.0" ?>
> <schema name="schema" version="1.2">
>     <fields>
>         <!-- solar cloud version field -->
>         <field name="_version_" type="long" indexed="true" stored="true"/>
>         <!-- Common fields -->
>         <field name="id" type="string" indexed="true" stored="true"  
> multiValued="false" required="true"/>
>         <field name="index_type" type="string" indexed="true"  stored="true"  
> multiValued="false" required="true"/>
>         <field name="year" type="int" indexed="true" stored="true"/>
>         <field name="model" type="string" indexed="true" stored="true"/>
>         <field name="year_make_model" type="string" indexed="true" 
> stored="true"/>
>     </fields>
>     <!-- Field Types -->
>     <types>
>         <fieldType name="string" class="solr.StrField" sortMissingLast="true" 
> />
>         <fieldType name="boolean" class="solr.BoolField" 
> sortMissingLast="true"/>
>         <fieldType name="int" class="solr.TrieIntField" precisionStep="0" 
> positionIncrementGap="0"/>
>         <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" 
> positionIncrementGap="0"/>
>         <fieldType name="long" class="solr.TrieLongField" precisionStep="0" 
> positionIncrementGap="0"/>
>         <fieldType name="double" class="solr.TrieDoubleField" 
> precisionStep="0" positionIncrementGap="0"/>
>         <fieldType name="date" class="solr.TrieDateField" precisionStep="0" 
> positionIncrementGap="0"/>
>         <fieldType name="text_ngram" class="solr.TextField" 
> positionIncrementGap="100">
>             <analyzer type="index">
>                 <tokenizer class="solr.StandardTokenizerFactory"/>
>                 <filter class="solr.StopFilterFactory" ignoreCase="true" 
> words="stopwords.txt" />
>                 <filter class="solr.LowerCaseFilterFactory"/>
>                 <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" 
> maxGramSize="15"/>
>             </analyzer>
>             <analyzer type="query">
>                 <tokenizer class="solr.StandardTokenizerFactory"/>
>                 <filter class="solr.StopFilterFactory" ignoreCase="true" 
> words="stopwords.txt" />
>                 <filter class="solr.SynonymFilterFactory" 
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>                 <filter class="solr.LowerCaseFilterFactory"/>
>             </analyzer>
>         </fieldType>
>         <fieldType name="text_general" class="solr.TextField" 
> positionIncrementGap="100">
>             <analyzer type="index">
>                 <tokenizer class="solr.StandardTokenizerFactory"/>
>                 <filter class="solr.StopFilterFactory" ignoreCase="true" 
> words="stopwords.txt" />
>                 <filter class="solr.LowerCaseFilterFactory"/>
>                 <filter class="solr.EdgeNGramFilterFactory" minGramSize="2" 
> maxGramSize="15"/>
>             </analyzer>
>             <analyzer type="query">
>                 <tokenizer class="solr.StandardTokenizerFactory"/>
>                 <filter class="solr.StopFilterFactory" ignoreCase="true" 
> words="stopwords.txt" />
>                 <filter class="solr.SynonymFilterFactory" 
> synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
>                 <filter class="solr.LowerCaseFilterFactory"/>
>             </analyzer>
>         </fieldType>
>         <fieldType name="location_rpt" 
> class="solr.SpatialRecursivePrefixTreeFieldType" geo="true" 
> distErrPct="0.025" maxDistErr="0.000009" units="degrees" />
>     </types>
>     <uniqueKey>id</uniqueKey>
>     <defaultSearchField>name</defaultSearchField>
>     <solrQueryParser defaultOperator="OR"/>
> </schema>
> {code}
> query :
> {code}
> http://solr.dev:8983/solr/my_collection/select?wt=json&fl=id&fq=index_type:foobar&group=true&group.field=year_make_model&group.facet=true&facet=true&facet.field=year
> {code}
> Exception :
> {code}
> ull:org.apache.solr.common.SolrException: Exception during facet.field: year
>     at org.apache.solr.request.SimpleFacets$3.call(SimpleFacets.java:627)
>     at org.apache.solr.request.SimpleFacets$3.call(SimpleFacets.java:612)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at org.apache.solr.request.SimpleFacets$2.execute(SimpleFacets.java:566)
>     at 
> org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:637)
>     at 
> org.apache.solr.request.SimpleFacets.getFacetCounts(SimpleFacets.java:280)
>     at 
> org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:106)
>     at 
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:222)
>     at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
>     at org.apache.solr.core.SolrCore.execute(SolrCore.java:1984)
>     at 
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:829)
>     at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:446)
>     at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:220)
>     at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
>     at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
>     at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
>     at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
>     at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>     at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
>     at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
>     at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>     at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
>     at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>     at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
>     at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
>     at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>     at org.eclipse.jetty.server.Server.handle(Server.java:368)
>     at 
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
>     at 
> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
>     at 
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
>     at 
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
>     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
>     at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
>     at 
> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
>     at 
> org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
>     at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>     at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>     at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.IllegalStateException: unexpected docvalues type NUMERIC 
> for field 'year' (expected=SORTED). Use UninvertingReader or index with 
> docvalues.
>     at org.apache.lucene.index.DocValues.checkField(DocValues.java:208)
>     at org.apache.lucene.index.DocValues.getSorted(DocValues.java:264)
>     at 
> org.apache.lucene.search.grouping.term.TermGroupFacetCollector$SV.doSetNextReader(TermGroupFacetCollector.java:135)
>     at 
> org.apache.lucene.search.SimpleCollector.getLeafCollector(SimpleCollector.java:33)
>     at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:705)
>     at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:428)
>     at 
> org.apache.solr.request.SimpleFacets.getGroupedCounts(SimpleFacets.java:532)
>     at 
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:458)
>     at 
> org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:381)
>     at org.apache.solr.request.SimpleFacets$3.call(SimpleFacets.java:621)
>     ... 37 more
> org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error 
> from server at http://10.0.2.15:8983/solr/my_collection_shard2_replica1: 
> Exception during facet.field: year
>     at 
> org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:556)
>     at 
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:233)
>     at 
> org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:225)
>     at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1220)
>     at 
> org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:221)
>     at 
> org.apache.solr.handler.component.HttpShardHandler$1.call(HttpShardHandler.java:184)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>     at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>     at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>     at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to