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 Rui António da Cruz Pereira <ru...@gmail.com> on 2009/03/13 11:46:07 UTC

DIH with outer joins

I have queries with outer joins defined in some entities and for the 
same root object I can have two or more lines with different objects, 
for example:

Taking the following 3 tables, andquery defined in the entity with outer 
joins between tables:
Table1 -> Table2 -> Table3

I can have the following lines returned by the query:
Table1Instance1 -> Table2Instance1 -> Table3Instance1
Table1Instance1 -> Table2Instance1 -> Table3Instance2
Table1Instance1 -> Table2Instance2 -> Table3Instance3
Table1Instance2 -> Table2Instance3 -> Table3Instance4

I wanted to have a single document per root object instance (in this 
case per Table1 instance) but with the values from the different lines 
returned.

Is it possible to have this behavior in DataImportHandler? How?

Thanks in advance,
   Rui Pereira

Re: DIH with outer joins

Posted by Walter Underwood <wu...@netflix.com>.
It may be easier to make a view in the database and index the view.
Databases have good tools for that.

wunder

On 3/13/09 2:46 AM, "Rui António da Cruz Pereira" <ru...@gmail.com>
wrote:

> I have queries with outer joins defined in some entities and for the
> same root object I can have two or more lines with different objects,
> for example:
> 
> Taking the following 3 tables, andquery defined in the entity with outer
> joins between tables:
> Table1 -> Table2 -> Table3
> 
> I can have the following lines returned by the query:
> Table1Instance1 -> Table2Instance1 -> Table3Instance1
> Table1Instance1 -> Table2Instance1 -> Table3Instance2
> Table1Instance1 -> Table2Instance2 -> Table3Instance3
> Table1Instance2 -> Table2Instance3 -> Table3Instance4
> 
> I wanted to have a single document per root object instance (in this
> case per Table1 instance) but with the values from the different lines
> returned.
> 
> Is it possible to have this behavior in DataImportHandler? How?
> 
> Thanks in advance,
>    Rui Pereira