Thanks Em.
Yes, OS06Y is the uniqueKey.
Table1 and Table2 is parallel in my example.
In the Url:
http://wiki.apache.org/solr/DIHQuickStart#Index_data_from_multiple_table
s_into_Solr
The tables don't have parallel relations in the above URL example
I want to know that can solr implement the case?
1.Get data from database table1;
2.Get data from database table2;
3.merge the fields of table1 and table2;

The configuration of db-data-config.xml is the following:
<document name="allperf">
    <entity name="PerformanceData1"
dataSource="getTrailingTotalReturnForMonthEnd1" query="SELECT Perfo
rmanceId,Trailing1MonthReturn,Trailing2MonthReturn,Trailing3MonthReturn,
FROM  Table1">
        <field column="PerformanceId" name="OS06Y" />
        <field column="Trailing1MonthReturn" name="PM004" />
        <field column="Trailing2MonthReturn" name="PM133" />
        <field column="Trailing3MonthReturn" name="PM006" />
            </entity>
<entity name="PerformanceData2"
dataSource="getTrailingTotalReturnForMonthEnd2" query="SELECT Performan
ceId,Trailing10YearReturn,Trailing15YearReturn,TrailingYearToDateReturn,
SinceInceptionReturn FROM Table2">
        <field column="PerformanceId" name="OS06Y" />
        <field column="Trailing10YearReturn" name="PM00I" />
        <field column="Trailing15YearReturn" name="PM00K" />
        <field column="TrailingYearToDateReturn" name="PM00A" />
        <field column="SinceInceptionReturn" name="PM00M" />
    </entity>
</document>

Because I don't want to get one id and data from table1 and then get the
data by id from table2,it may met performance issue.

-----Original Message-----
From: Em [mailto:mailformailingli...@yahoo.de] 
Sent: Thursday, April 21, 2011 4:38 PM
To: solr-user@lucene.apache.org
Subject: Re: The issue of import data from database using Solr DIH

Hi Kevin,

I think you made OS06Y the uniqueKey, right?
So, in entity 1 you specify values for it, but in entity 2 you do so as
well. 
I am not absolutely sure about this, but: It seems like your two
entities
create two documents and the second will overwrite the first.

Have a look at this page:
http://wiki.apache.org/solr/DIHQuickStart#Index_data_from_multiple_table
s_into_Solr

I think it will help you in rewriting your queries to fit your usecase.

Regards,
Em

--
View this message in context:
http://lucene.472066.n3.nabble.com/The-issue-of-import-data-from-databas
e-using-Solr-DIH-tp2845318p2846296.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to