Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5260

Faceting on a field in SolrCloud with docValues=true and indexed=false fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.4
    • 6.4, 7.0
    • search, SolrCloud
    • None

    Description

      I have a problem doing facet search on a doc value field in a multi shard collection.

      My Solr schema specifies fieldA as a docvalue type and I have created a two shard collection using Solr 4.4.0 (and the unreleased 4.5 branch).
      When I do a facet search on fieldA with a "large" facet.limit then the query fails with the below exception
      A "large" facet.limit seems to be when (10 + (facet.limit * 1,5)) * number of shards > rows matching my query

      The exception does not occur when I run with a single shard collection.
      It can easily be reproduced by indexing a single row and querying it, as the default facet.limit is 100.

      The facet query received by Solr looks as follows:

          576793 [qtp170860084-18] INFO  org.apache.solr.core.SolrCore  ¦ [trym_shard2_replica1] webapp=/solr path=/select 
           params={facet=true&start=0&q=*:*&distrib=true&collection=trym&facet.field=fieldA&wt=javabin&version=2&rows=0} 
           status=500 QTime=20
      

      One of the "internal query" send by Solr to its shard looks like

          576783 [qtp170860084-19] INFO  org.apache.solr.core.SolrCore  ¦ [trym_shard1_replica1] webapp=/solr path=/select 
           params={facet=true&distrib=false&collection=trym&wt=javabin&version=2&rows=0&NOW=1379855011787    
             &shard.url=192.168.56.1:8501/solr/trym_shard1_replica1/&df=text&fl=id,score&f.fieldA.facet.limit=160
             &start=0&q=*:*&facet.field=fieldA&isShard=true&fsv=true} 
           hits=1 status=500 QTime=2
      

      The exception thrown by Solr is as follows

      576784 [qtp170860084-17] ERROR org.apache.solr.servlet.SolrDispatchFilter  ¦ null:java.lang.IllegalStateException: 
           Cannot use facet.mincount=0 on a field which is not indexed
              at org.apache.solr.request.NumericFacets.getCounts(NumericFacets.java:257)
              at org.apache.solr.request.SimpleFacets.getTermCounts(SimpleFacets.java:423)
              at org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:530)
              at org.apache.solr.request.SimpleFacets.getFacetCounts(SimpleFacets.java:259)
              at org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:78)
              at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
              at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
              at org.apache.solr.core.SolrCore.execute(SolrCore.java:1904)
              at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:659)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:362)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158)
              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:235)
              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:724)
      

      My schema.xml contains the following lines (among others )

          <dynamicField name="*A" type="dlong" indexed="false" stored="true" docValues="true" required="true"/>
          ...
          <fieldType name="dlong" class="solr.TrieLongField" docValuesFormat="Disk" precisionStep="0" positionIncrementGap="0"/>
      

      Attachments

        1. SOLR-5260.patch
          22 kB
          Erick Erickson
        2. SOLR-5260-testfix.patch
          4 kB
          Erick Erickson

        Issue Links

          Activity

            People

              erickerickson Erick Erickson
              trym Trym Møller
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: