Solr
  1. Solr
  2. SOLR-1009

repeated column names result in duplicate values

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Labels:
      None

      Description

      Duplicate column names result in the same value getting copied multiple times

      http://markmail.org/thread/mguseggrldkddcut

      1. SOLR-1009.patch
        0.9 kB
        Noble Paul

        Activity

        Hide
        Noble Paul added a comment -

        the fix

        check if they are duplicate and create only a single destination field

        Show
        Noble Paul added a comment - the fix check if they are duplicate and create only a single destination field
        Hide
        Shalin Shekhar Mangar added a comment -

        Would it be better to throw an exception during validation because specifying the same column multiple times is not really valid? A user may incorrectly specify the same column name with different transformers etc. but only one of the field's value will be added to the document and the user would be left wondering why the other values are not getting picked up.

        Show
        Shalin Shekhar Mangar added a comment - Would it be better to throw an exception during validation because specifying the same column multiple times is not really valid? A user may incorrectly specify the same column name with different transformers etc. but only one of the field's value will be added to the document and the user would be left wondering why the other values are not getting picked up.
        Hide
        Noble Paul added a comment -

        Would it be better to throw an exception during validation because specifying the same column multiple times is not really valid

        not really. The user reported usecase is a valid one. It may not be valid for SqlEntityProcessor but in XPathEntityProcessor he needs those fields becausehe has to put different 'xpath' . it is easy to workaround with a correct name, but it it not obvious

        Show
        Noble Paul added a comment - Would it be better to throw an exception during validation because specifying the same column multiple times is not really valid not really. The user reported usecase is a valid one. It may not be valid for SqlEntityProcessor but in XPathEntityProcessor he needs those fields becausehe has to put different 'xpath' . it is easy to workaround with a correct name, but it it not obvious
        Hide
        Shalin Shekhar Mangar added a comment -

        But what if more than one xpath match? The map can contain only one value, which one should it be?

        e.g.

        <field column="x" xpath="/root/a" />
        <field column="x" xpath="/root/b/a" />
        

        If the XML has both /root/a and /root/b/a, which value should be added to the document? Right now, one the values will get overwritten.

        Show
        Shalin Shekhar Mangar added a comment - But what if more than one xpath match? The map can contain only one value, which one should it be? e.g. <field column= "x" xpath= "/root/a" /> <field column= "x" xpath= "/root/b/a" /> If the XML has both /root/a and /root/b/a, which value should be added to the document? Right now, one the values will get overwritten.
        Hide
        Shalin Shekhar Mangar added a comment -

        Committed revision 743280.

        Thanks Noble!

        I understood the patch now, we need to clearly document on the wiki that in case of single valued field, XPathEntityProcessor may overwrite values. This problem is not present with other entity processors.

        Show
        Shalin Shekhar Mangar added a comment - Committed revision 743280. Thanks Noble! I understood the patch now, we need to clearly document on the wiki that in case of single valued field, XPathEntityProcessor may overwrite values. This problem is not present with other entity processors.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for Solr 1.4

        Show
        Grant Ingersoll added a comment - Bulk close for Solr 1.4

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Noble Paul
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development