You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by je...@trend.com.tw on 2011/03/26 14:00:13 UTC

DIH relating multiple DataSources

Hi All,

I'm a newbie to SOLR and is hoping to get some help.

I was able to get DIH to work with one datasource. What I'm trying to achieve is using two datasources to build my document. Below is my data-config:

<dataConfig>
<dataSource name="localDB" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/ebook" user="ebook" password="masked" batchSize="1" />
<dataSource name="remoteDB" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://tw-stntlab1:3306/test" user="root" password="masked" batchSize="1" />
    <document name="epub">
		<entity dataSource="localDB" rootEntity="true" name="epub" pk="ID" query="select * from epub">
            <field column="ID" name="id" />
            <field column="Name" name="url" />
            <field column="Author" name="content" />
			<entity dataSource="remoteDB" name="test" query="select TESTCOLUMN from jctest where ID='${epub.ID}'">
				<field column="TESTCOLUMN" name="title" />
			</entity>
        </entity>
    </document>
</dataConfig>

If the above possible? I can't seem to get my "title" field above populated from a second datasource but the fields identified in my rootEntity using the first datasource works perfectly fine.

Thanks,
Jeff
TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.


Re: DIH relating multiple DataSources

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: DIH relating multiple DataSources
: In-Reply-To: <13...@webmail.messagingengine.com>
: References:
:     <AA...@mail.gmail.com><AANLkTinr=r
:     +-N3HFNRbT1Cx4gvkv-A=CgW5FeMuOxbXm@mail.gmail.com>
:  <AA...@mail.gmail.com>
:  <13...@webmail.messagingengine.com>

http://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.




-Hoss