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

Multiple CopyField should not limit to first maxChars

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 9.0, 9.1
    • 9.1, main (10.0)
    • Schema and Analysis
    • None

    Description

      We’ve stumbled upon something that seems like a bug.  The behaviour is changed since solr 8.11.  

      If we setup copyfield with maxChars, this is “remembered” for all other copyField-operations (at least for the same source field).

      From schema.xml:
      <field name="searchablefield" type="text" indexed="true" stored="true" multiValued="true"/>
      <field name="genteaser" type="text" indexed="false" stored="true"/>

      Input doc:
      body:“On a brighter note, they have a phone number to call if you are interested in volunteering.  You can call 860 - 690 - 4300 ext 2.  (there are a lot of forms to fill out, and they are asking for info on when the babies are due)  There was a lady in here yesterday asking how to volunteer.  She is 2 - 3 months pregnant and wants to get her hands dirty.  She says her husband will be home at the time, but can't drive, so she wants to be able to help out.  So I told her the names of the people who are in charge, and also pointed her in the direction of a site where she can make an appointment to drop off some pre - packaged meals.  I'll let you know what I hear from them when I do.  One day I had not posted because all I was going to do was complain about how the morning sickness is wearing me out!  Then I thought, I can make this an uplifting post, so I'll share with you about my friend Jackie, who I met in high school, who went through this 2 years ago with her first baby, Samuel."

      search with qf=searchablefield for q=“Samuel"

      HIT (OK)
      <copyField source="body" dest="genteaser" />
      <copyField source="body" dest="searchablefield"/>

      HIT (OK)
      <copyField source="body" dest="searchablefield"  maxChars="3000000"/>
      <copyField source="body" dest="genteaser" maxChars="300"/>

      NO HIT (as expected)
      <copyField source="body" dest="searchablefield"  maxChars="300"/>
      <copyField source="body" dest="genteaser" maxChars="300”/>

      NO HIT (BUG):
      <copyField source="body" dest="genteaser" maxChars="300"/>
      <copyField source="body" dest="searchablefield"  maxChars="300000”/>

      NO HIT (BUG):
      <copyField source="body" dest="genteaser" maxChars="300"/>
      <copyField source="body" dest="searchablefield"/>

      Included a patch with a couple of new fields added to schema.xml and a failing test.

       

      This was also posted to the user mailling list.

      Attachments

        1. maxchars.patch
          4 kB
          Fredrik Rodland

        Issue Links

          Activity

            People

              krisden Kevin Risden
              fmr Fredrik Rodland
              Votes:
              1 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 - 1h 20m
                  1h 20m