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

JsonFacetingResponse classes should record provide access to count fields as longs

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.7.1
    • Fix Version/s: 8.1
    • Component/s: SolrJ
    • Labels:
      None

      Description

      JsonFacetingResponse and its series of dependent classes hold a variety of count fields for bucket counts and various optional properties (allBuckets, numBuckets, etc.). Currently, some of the code that parses these values out of the originating NamedList either stores or casts the values as ints. When doc counts are low this works fine. But when the doc counts become larger and stray into "long" territory, SolrJ is liable to blow up with ClassCastExceptions.

      A user on the list reported on of these with the partial stack trace:

      Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
            at org.apache.solr.client.solrj.response.json.NestableJsonFacet.<init>(NestableJsonFacet.java:52)
            at org.apache.solr.client.solrj.response.QueryResponse.extractJsonFacetingInfo(QueryResponse.java:200)
            at org.apache.solr.client.solrj.response.QueryResponse.getJsonFacetingResponse(QueryResponse.java:571)
      

      We should fix this so that these classes can be used without incident for any doc counts.

        Attachments

        1. SOLR-13318-branch_8x.patch
          7 kB
          Munendra S N
        2. SOLR-13318.patch
          3 kB
          Munendra S N
        3. SOLR-13318.patch
          6 kB
          Munendra S N

          Issue Links

            Activity

              People

              • Assignee:
                gerlowskija Jason Gerlowski
                Reporter:
                gerlowskija Jason Gerlowski
              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: