[ 
https://issues.apache.org/jira/browse/SOLR-3842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13504105#comment-13504105
 ] 

James Dyer commented on SOLR-3842:
----------------------------------

>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

                
> DataImportHandler: When attempting to use column values as field names, 
> multivalued fields only retain the first result
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-3842
>                 URL: https://issues.apache.org/jira/browse/SOLR-3842
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.0-BETA
>            Reporter: Eric Kingston
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to