If I understand your question right ... you would not need a transformer, basically you nest entities under each other ... ie:

<?xml version="1.0"?>
<dataConfig>
<dataSource name="db" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/nhldb? connectTimeout=0&amp;autoReconnect=true" user="root" password="" batchSize="-1"/>
<document name="doc1">
<entity dataSource="db" name="first" pk="ID" query="select col1, col2 from table1">
  <field column="col1" name="col1"/>
  <field column="col2" name="col2"/>
<entity dataSource="db" name="second'" query="select col3 from table2 where Iid='${first.col1}'" processor="org.apache.solr.handler.dataimport.CachedSqlEntityProcessor">
    <field column="col3" name="col3"/>
  </entity>
</entity>
</document>
</dataConfig>

I believe that is the basic steps. Look up CachedSqlEntityProcessor to see if you need it.

- Jon

On Sep 27, 2008, at 5:47 PM, Britske wrote:


Looking at the wiki, code of DataImportHandler and it looks impressive. There's talk about ways to use Transformers to be able to create several
rows (solr docs) based on a single db row.

I'd like to know if it's possible to do the exact opposite: to build
customer transformers that take multiple db-rows and merge it to a single
solr-row/document. If so, how?

Thanks,
Britske
--
View this message in context: 
http://www.nabble.com/DataImportHandler%3A-way-to-merge-multiple-db-rows-to-1-doc-using-transformer--tp19706722p19706722.html
Sent from the Solr - User mailing list archive at Nabble.com.


Reply via email to