Luis Pabon created SOLR-4402:
--------------------------------

             Summary: Creating dynamically named fields in requires a 
Transformer
                 Key: SOLR-4402
                 URL: https://issues.apache.org/jira/browse/SOLR-4402
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 4.1
         Environment: Ubuntu 12.04 LTS, fresh download of SOLR.
            Reporter: Luis Pabon
            Priority: Minor


I needed to index multiple fields from a table dynamically. At first it didn't 
work, reading the field name as "_t". Out of curiosity, I added a transformer 
declaration to the entity. This gave me the list of fields I needed.

Why did adding a transformer that is never used fix my problem? Removing the 
transformer declaration causes the problem to come back, and it does not matter 
which transformer I declare.

I am running Solr 4.1, and this issue first happened to me on the included 
example-DIH example that came with the download. I read the Solr reference 
guide for 4.0, and could not find a reason why adding a transformer made it 
work.

Below is the db-data-config.xml file:
{code:xml} 
    <dataConfig>
        <dataSource name="foo" driver="com.mysql.jdbc.Driver" 
url="jdbc:mysql://localhost/foo"  user="fakeadmin" password="fakepass"/>
        <document>
                <entity name="products" query="select * from `product`">
                        <field name="id" column="id" />
                        <entity name="names" query="select * from names where 
productId = '${products.id}'" transformer="LogTransformer">
                                <field name="${names.fieldName}_t" 
column="fieldValue"/>
                        </entity>
                </entity>
        </document>
</dataConfig>
{code} 

--
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