lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kay <>
Subject Indexing Multiple Datasources
Date Mon, 11 Jun 2012 15:59:23 GMT

We have 2 MS SQL Server Databases which we wanted to index .But most of the
columns in the Databases have the same names. For e.g. Both the DB’s have
the columns First name ,Last name ,etc.

How can you index multiple Databases using single db-data-config file and
one schema? 

Here is my data-config file

<dataSource type="JdbcDataSource" name="ds-2"
url="jdbc:sqlserver://localhost;DatabaseName= " user="" password="" />
    <document name="PersonTable">
		<entity dataSource="ds-2" name="People" query="SELECT
BusinessEntityID,FirstName,LastName FROM dbo.PersonTable">
			<field column="BusinessEntityID" name="BusinessEntityID" />
			<field column="FirstName" name="FirstName" />
			<field column="LastName" name="LastName" />
			<field column="Department" name="Department" />
			<field column="Age" name="Age" />
    <document name="person">
		<entity dataSource="ds-1" name="People" query="SELECT   
FROM AdventureWorks.Person.Person">
			<field column="BusinessEntityID" name="BusinessEntityID" />
			<field column="NameStyle" name="NameStyle" />
			<field column="Title" name="Title" />
			<field column="FirstName" name="FirstName" />
			<field column="MiddleName" name="MiddleName" />
			<field column="LastName" name="LastName" />
			<field column="ModifiedDate" name="ModifiedDate" />
And schema file:

<field name="BusinessEntityID" type="string" indexed="true" stored="true"
<field name="NameStyle" type="string" indexed="true" stored="true"/>
<field name="Title" type="string" indexed="true" stored="true"/>
<field name="FirstName" type="string" indexed="true" stored="true"/>
<field name="MiddleName" type="string" indexed="true" stored="true"/>
<field name="LastName" type="string" indexed="true" stored="true"/>
<field name="Department" type="string" indexed="true" stored="true"/>
<field name="Age" type="string" indexed="true" stored="true"/>


We would appreciate your help!


View this message in context:
Sent from the Solr - User mailing list archive at

View raw message