Solr
  1. Solr
  2. SOLR-3226

SignatureUpdateProcessor ignores non-string field values from the signature generation

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0-ALPHA
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: update
    • Labels:
      None

      Description

      When using for example XMLUpdateRequestProcessor, the signature is calculated correctly since all field values are strings. But when one uses DataImportHandler or BinaryUpdateRequestHandler, the signature generation will ignore any field values that are ints, longs, dates etc.

      This might result in overwriting non-similar documents, as it happened in my case while importing some db data through DIH.

      1. SOLR-3226.patch
        7 kB
        Hoss Man
      2. SOLR-3226.patch
        5 kB
        Spyros Kapnissis

        Issue Links

          Activity

          Hide
          Spyros Kapnissis added a comment -

          I'm adding a small patch that adds a simple String.valueOf for any field that fails the instanceof String typecheck.

          Show
          Spyros Kapnissis added a comment - I'm adding a small patch that adds a simple String.valueOf for any field that fails the instanceof String typecheck.
          Hide
          Hoss Man added a comment -

          Hmmm .... just noticed this jira ... this definitely seems like a really bad bug.

          Spyros: thank you so much for your patch (including tests!) ... i've updated it to also fix the case of Collections that contain non string.

          Show
          Hoss Man added a comment - Hmmm .... just noticed this jira ... this definitely seems like a really bad bug. Spyros: thank you so much for your patch (including tests!) ... i've updated it to also fix the case of Collections that contain non string.
          Hide
          Hoss Man added a comment -

          I wanna commit this into 3.6 ... but i'd like to get mark miller to sanity check th patch first (the instanceof String seems so deliberate i'm not sure if i'm missing something - i've pinged him on IRC to see if he can review ASAP)

          Suggested special text for the upgrading section in CHANGES.txt...

          A bug found and fixed in the SignatureUpdateProcessor that previously caused some 
          documents to produce the same signature even when the configured fields contained 
          distinct (non-String) values.  Users of SignatureUpdateProcessor are strongly advised 
          that they should re-index as document signatures may have now changed. 
          (see SOLR-3226 for details)
          
          Show
          Hoss Man added a comment - I wanna commit this into 3.6 ... but i'd like to get mark miller to sanity check th patch first (the instanceof String seems so deliberate i'm not sure if i'm missing something - i've pinged him on IRC to see if he can review ASAP) Suggested special text for the upgrading section in CHANGES.txt... A bug found and fixed in the SignatureUpdateProcessor that previously caused some documents to produce the same signature even when the configured fields contained distinct (non-String) values. Users of SignatureUpdateProcessor are strongly advised that they should re-index as document signatures may have now changed. (see SOLR-3226 for details)
          Hide
          Hoss Man added a comment -

          Committed revision 1308604. - trunk

          ...had to make a tweak to schema-luceneMatchVersion.xml to get all tests working however (TestMatchVersions uses same solrconfig.xml but diff schema.xml, so it freaked about "id" not existing)

          still testing the backport to 3x ... there were some other subtle tweaks needed there to the test because of branch drift

          Show
          Hoss Man added a comment - Committed revision 1308604. - trunk ...had to make a tweak to schema-luceneMatchVersion.xml to get all tests working however (TestMatchVersions uses same solrconfig.xml but diff schema.xml, so it freaked about "id" not existing) still testing the backport to 3x ... there were some other subtle tweaks needed there to the test because of branch drift
          Hide
          Hoss Man added a comment -

          Committed revision 1308625. - 3x

          Show
          Hoss Man added a comment - Committed revision 1308625. - 3x

            People

            • Assignee:
              Hoss Man
              Reporter:
              Spyros Kapnissis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development