lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From caman <>
Subject Document model suggestion
Date Tue, 15 Dec 2009 01:56:45 GMT

Appreciate any guidance here please. Have a master-child table between two
tables 'TA' and 'TB' where form is the master table. Any row in TA can have
multiple row in TB.
e.g. row in TA 



This is how I am trying to model this in SOLR
            <entity name="TA" query="select * from TA"
                deltaQuery="select id from TA where (last_updated >
'${dataimporter.last_index_time}' or date_created >
'${dataimporter.last_index_time}')"  deltaImportQuery="select * from TA
where ID='${}'">
            <field column="name" name="name" />
            <field column="name" name="nameSort" />
            <field column="name" name="alphaNameSort" />

            <entity name="TB"  
id,field0,field1,field2,field3,field4,ta_id from TB where ta_id='${}'"
                    deltaQuery="select ta_id from TB where (last_updated >
'${dataimporter.last_index_time}' or date_created >
                    parentDeltaQuery="select id from TA where
id=${TB.ta_id}" >
				<field name="dataId" column="id" />	
				 <field name="attr0" column="field0" />
				<field name="attr1" column="field1" />
				<field name="attr2" column="field2" />
				<field name="attr3" column="field3" />
				<field name="attr4" column="field4" />

This works fine and index the data.But all the data for a row in TA gets
combined in one document(not desirable).
I am not clear on how to 

1) separate a particular row from the search results. 
e.g. If I search for 'Android' and there are 5 rows for android in TB for a
particular instance in TA, would like to show them separately to user and if
the user click on any of the row,point them to an attached URL in the
application. Should a separate index be maintained for each row in TB?TB can
have millions of rows.
2) How to protect one user's data from another user. I guess I can keep a
column for a user_id in the schema and append that filter automatically when
I search through SOLR. Any better alternatives? 

Bear with me if these are newbie questions please, this is my first day with


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

View raw message