Alex, Thanks, I tried ${item.id}, it doesn’t work. However, if hardcode a id number instead of '${item.id}’ , the it add this one line to every document.
for example select description from feature where item_id=3456 then this single description is added to every document as a field. it seems the parent entity item.id is not passed to the second entity. Thanks, Qiu Mo (Joe) ________________________________________ From: Alexandre Rafalovitch <arafa...@gmail.com> Sent: Friday, January 23, 2015 3:25 PM To: solr-user Subject: Re: multiple data source indexing through data import handler Try ${item.id} as that's what you are mapping it to. See also: https://issues.apache.org/jira/browse/SOLR-4383 Regards, Alex. ---- Sign up for my Solr resources newsletter at http://www.solr-start.com/ On 23 January 2015 at 15:01, Qiu Mo <q...@tampabay.com> wrote: > I am indexing data from two different databases, but I can't add second > database to indexing, can anyone help! below is my dats-config.xml > > > <dataSource type="JdbcDataSource" name="ds-1" driver="org.postgresql.Driver" > url="jdbc:mysql://XXX" user="XXX" password="XXX"/> > > <dataSource type="JdbcDataSource" name="ds-2" driver="com.mysql.jdbc.Driver" > url="jdbc:mysql://XXX" user="XXX" password="XXX"/> > > > <entity name="item" dataSource="ds-1" query="select * from item"> > > <field column="ID" name="id" /> > > <field column="NAME" name="name" /> > > > <entity name="factory" dataSource="ds-2" query="select > description from feature where item_id='${item.ID}'"> > > <field name="features" column="description" /> > > </entity> > > > > </entity> > > my log indicate that '${item.ID}' is not catch any value from entity item. > > Thanks, > > Joe Moore