Solr
  1. Solr
  2. SOLR-3842

DataImportHandler: When attempting to use column values as field names, multivalued fields only retain the first result

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-BETA
    • Fix Version/s: 4.1, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Can you please verify if this issue is simply due to improper implementation, or if it's a bug in Solr?

      http://stackoverflow.com/questions/12412040/solr-dataimporthandler-when-attempting-to-use-column-values-as-field-names-m

      Also, I should note that a static reference to fieldB does handle multiple values correctly.
      Example: <field name="fieldB" column="VALUE_COLUMN" clob="true" />

      It only fails when I try to set the field names dynamically.

        Issue Links

          Activity

          Hide
          James Dyer added a comment -

          From Stackoverflow:

          I'm trying to perform a full-import with document configuration similar to the following:

          <document>
          <entity name="parent" query="select * from parent_table" >
          <field name="id" column="ID" />
          <entity name="child" query="select * from child_table where PARENT_ID = $

          {parent.ID}

          " transformer="ClobTransformer" >
          <field name="$

          {child.FIELD_COLUMN}

          " column="VALUE_COLUMN" clob="true" />
          </entity>
          </entity>
          </document>

          Let's say the field/value results from the child_table for parent.ID=1 look like this:

          FIELD_COLUMN VALUE_COLUMN
          fieldA value1
          fieldB value2
          fieldB value3

          And the schema configuration for fieldA and fieldB (note that fieldB is multivalued):

          <field name="fieldA" type="string" indexed="true" stored="true" multiValued="false"/>
          <field name="fieldB" type="string" indexed="true" stored="true" multiValued="true" />

          After running full-import, the document for parent 1 looks like this:

          {"id":1, "fieldA":"value1", "fieldB":["value2"]}

          But, I need (and was expecting) it to look like this instead (fieldB should have multiple values):

          {"id":1, "fieldA":"value1", "fieldB":["value2","value3"]}

          Any help would be greatly appreciated!! Thanks!

          Solr version: 4.0.0.2012.08.06.22.50.47

          Show
          James Dyer added a comment - From Stackoverflow: I'm trying to perform a full-import with document configuration similar to the following: <document> <entity name="parent" query="select * from parent_table" > <field name="id" column="ID" /> <entity name="child" query="select * from child_table where PARENT_ID = $ {parent.ID} " transformer="ClobTransformer" > <field name="$ {child.FIELD_COLUMN} " column="VALUE_COLUMN" clob="true" /> </entity> </entity> </document> Let's say the field/value results from the child_table for parent.ID=1 look like this: FIELD_COLUMN VALUE_COLUMN fieldA value1 fieldB value2 fieldB value3 And the schema configuration for fieldA and fieldB (note that fieldB is multivalued): <field name="fieldA" type="string" indexed="true" stored="true" multiValued="false"/> <field name="fieldB" type="string" indexed="true" stored="true" multiValued="true" /> After running full-import, the document for parent 1 looks like this: {"id":1, "fieldA":"value1", "fieldB":["value2"]} But, I need (and was expecting) it to look like this instead (fieldB should have multiple values): {"id":1, "fieldA":"value1", "fieldB":["value2","value3"]} Any help would be greatly appreciated!! Thanks! Solr version: 4.0.0.2012.08.06.22.50.47
          Hide
          James Dyer added a comment -

          fixed with SOLR-2141.

          Show
          James Dyer added a comment - fixed with SOLR-2141 .
          Hide
          Commit Tag Bot added a comment -
          Show
          Commit Tag Bot added a comment - [branch_4x commit] James Dyer http://svn.apache.org/viewvc?view=revision&revision=1414260 SOLR-2141 / SOLR-4047 / SOLR-3842 - remove tabs
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] James Dyer
          http://svn.apache.org/viewvc?view=revision&revision=1414250

          SOLR-2141 / SOLR-4047 / SOLR-3842 - fix problems with VariableResolver, better test coverage

          Show
          Commit Tag Bot added a comment - [branch_4x commit] James Dyer http://svn.apache.org/viewvc?view=revision&revision=1414250 SOLR-2141 / SOLR-4047 / SOLR-3842 - fix problems with VariableResolver, better test coverage

            People

            • Assignee:
              James Dyer
              Reporter:
              Eric Kingston
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development