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

maxChars no longer working on CopyField with Javabin

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.7, 7.7.1, 7.7.2, 8.0, 8.0.1, 8.1, 8.2, 7.7.3, 8.1.1, 8.1.2
    • Fix Version/s: 8.3
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      We recently upgraded from Solr 7.3 to 8.1, and noticed that the maxChars property on a copy field is no longer functioning as designed, while indexing via SolrJ. Per the most recent documentation it looks like there have been no intentional changes as to the functionality of this property, so I assume this is a bug.
       
      In debugging the issue, it looks like the bug was caused by SOLR-12992. In DocumentBuilder where the maxChar limit is applied, it first checks if the value is instanceof String. As of SOLR-12992, string values are now coming in as ByteArrayUtf8CharSequence (unless they are above a certain size as defined by JavaBinCodec.MAX_UTF8_SZ), so they are failing the instanceof String check, and the maxChar truncation is not being applied. 

       

      The issue seems to be limited to Javabin, docs indexed in other formats (where values come in as strings) are working fine.

        Attachments

        1. SOLR-13699.patch
          4 kB
          Noble Paul
        2. SOLR-13699.patch
          6 kB
          Chris Troullis

          Issue Links

            Activity

              People

              • Assignee:
                noble.paul Noble Paul
                Reporter:
                ctroullis Chris Troullis
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m