Hi Romi,

A simple way to do so is to define in your schema.xml the union of all the columns you need plus a "type" field to distinguish your entities.

eg, In your DB

table1 :
- col1 : varchar
- col2 : int
- col3 : float
table2 :
- col1 : int
- col2 : varchar
- col3 : int
- col4 : varchar

in solr's schema :

field name="table1_col1" type="text"
field name="table1_col2" type="int"
field name="table1_col3" type="float"
field name="table2_col1" type="int"
field name="table2_col2" type="text"
field name="table2_col3" type="int"
field name="table2_col4" type="string"
field name="type" type="string" required="true" multivalued="false"

Ensure that when you add your documents, their "type" value is effectively set to either "table1" or table"2".

That's a possibility amongst others.

--
Tanguy

On 05/26/11 14:57, Romi wrote:
Hi, i was not getting reply for this post, so here i am reposting this,
please reply.

In my database i have two types of entity customer and product. I want to
index customer related information in one document and product related
information in other document. is it possible via solr , if so how can i
achieve this.

Thanks&  Regards
Romi.

-----
Romi
--
View this message in context: 
http://lucene.472066.n3.nabble.com/how-can-i-index-data-in-different-documents-tp2988621p2988621.html
Sent from the Solr - User mailing list archive at Nabble.com.


--
--
Tanguy

Reply via email to