Solr
  1. Solr
  2. SOLR-1973

Empty fields in update messages confuse DataImportHandler

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4, 1.4.1
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Labels:
      None
    • Environment:

      CentOS 5, Java 1.6, Tomcat 6

      Description

      I seem to be running into an issue with Solr (maybe just the DataImportHandler?) not liking empty field elements in the docs, and getting the wrong values into the fields of the index. Here's the entity declaration from data-config.xml for my isolated example:

      <document>
      <entity name="contentAsSolrAdd"
      dataSource="xml"
      processor="XPathEntityProcessor"
      stream="true"
      url="http://example.com/Content.xml"
      useSolrAddSchema="true">
      </entity>
      </document>

      And here's the Content.xml being pulled in by the DIH:

      <add>
      <doc>
      <field name="empty"></field>
      <field name="full">Lorem Ipsum Dolor</field>
      <field name="other">Some content is me!</field>
      </doc>
      </add>

      And here's the relevant portion of the output from the DIH in debug mode:

      <lst name="document#1">
      <str name="query">
      http://example.com/Content.xml
      </str>
      <str name="time-taken">0:0:0.6</str>
      <str>----------- row #1-------------</str>
      <str name="full">Some content is me!</str>
      <str name="empty">Lorem Ipsum Dolor</str>
      <str>---------------------------------------------</str>
      </lst>

      Notice that the field "full" doesn't appear here, but the following field "empty" has the content that was there for "full". The "other" field, which was non-empty, and preceded by a non-empty field, shows up correctly.

      1. SOLR-1973-test.patch
        2 kB
        Koji Sekiguchi
      2. SOLR-1973.patch
        2 kB
        Koji Sekiguchi
      3. SOLR-1973.patch
        4 kB
        Koji Sekiguchi

        Activity

        Grant Ingersoll made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Koji Sekiguchi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Koji Sekiguchi made changes -
        Fix Version/s 3.1 [ 12314371 ]
        Fix Version/s 4.0 [ 12314992 ]
        Affects Version/s 1.4.1 [ 12315096 ]
        Affects Version/s 1.4 [ 12313351 ]
        Affects Version/s 3.1 [ 12314371 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Koji Sekiguchi made changes -
        Assignee Koji Sekiguchi [ koji ]
        Koji Sekiguchi made changes -
        Attachment SOLR-1973.patch [ 12458982 ]
        Koji Sekiguchi made changes -
        Attachment SOLR-1973.patch [ 12458497 ]
        Koji Sekiguchi made changes -
        Field Original Value New Value
        Attachment SOLR-1973-test.patch [ 12458478 ]
        Sixten Otto created issue -

          People

          • Assignee:
            Koji Sekiguchi
            Reporter:
            Sixten Otto
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development