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 Paresh <kh...@gmail.com> on 2019/06/12 14:33:31 UTC

SOLR JOIN

Hi,

I have two collections both having different schema.
Collection1: ID, Field1, Field2
Collection3: ID, Oc1, OC2, col3_Field1
                 ID1, col3_Oc1
I want to do following JOINs

(-)Query on Collection1
(-)Field2:value2
(-)JOIN across collection3 Field1 = collection3.col3_Field1
           Inner JOIN in collection 3
           col3_oc1 = Oc1
I am able to achieve SELF JOIN within a collection and across JOIN as well.

But I am not able do both together.

Any help appreciated.




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Paresh <kh...@gmail.com>.
They are logically different that is why kept in different collections.
Collection1: The purpose is to do Global Text Search for all objects through
multiple document types
Collection3: The purpose is to have search for some other type of objects
whose documents are in Millions and takes GBs size.

On very specific purpose we need to go to collection3 and do JOIN with
collection1 to fetch some data and facets
Then go to collection1 and  JOIN with collection3 to get facets of
collection1 but no data.





--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Jörn Franke <jo...@gmail.com>.
Put them in one collection 

> Am 14.06.2019 um 07:17 schrieb Paresh <kh...@gmail.com>:
> 
> I am actually able to make this work by doing multiple JOINs -
> 1. Do query on Collection1
> 2. JOIN with Collection3 (document type1 field)
> 3. JOIN with Collection3 (document type2 field)
> 4. Do not fetch any data except faceting information
> 
> But the other problem is, it is very slow.
> 
> Are there any other solution when we have two collections and want data that
> satisfy fields from both collections and also get facets from both
> collection?
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Paresh <kh...@gmail.com>.
I am actually able to make this work by doing multiple JOINs -
1. Do query on Collection1
2. JOIN with Collection3 (document type1 field)
3. JOIN with Collection3 (document type2 field)
4. Do not fetch any data except faceting information

But the other problem is, it is very slow.

Are there any other solution when we have two collections and want data that
satisfy fields from both collections and also get facets from both
collection?



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Paresh <kh...@gmail.com>.
Hi Erick,

I am able to achieve querying on Collection3 with INNER JOIN between two
document types and JOIN across collection1 using below mechanism. I am also
getting facetting information from collection3 along with data.

http://localhost:8983/solr/collection3/tcfts?wt=json&indent=on&start=0&rows=50&q.op=AND&q=OC2:(9350)
AND _query_:"{!join from=col3_Oc1 to=Oc1}ID1:xtWNf_fTAaLUgD" AND
_query_:{!join to=col3_Field1 from=Field1
fromIndex=collection1}Field2:12010340

Now, I want to collect the faceting information for collection1 with the
same type of query but no data.
So what is needed is -
Query on collection1, match few columns with some expression and then do
JOIN across collection3 do INNER JOIN as above.

Could you help on this?




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Paresh <kh...@gmail.com>.
Hi Erick,

I am able to achieve querying on Collection3 with INNER JOIN between two
document types and JOIN across collection1 using below mechanism. I am also
getting facetting information from collection3 along with data.

http://localhost:8983/solr/collection3/tcfts?wt=json&indent=on&start=0&rows=50&q.op=AND&q=OC2:(9350)
AND _query_:"{!join from=col3_Oc1 to=Oc1}ID1:xtWNf_fTAaLUgD" AND
_query_:{!join to=col3_Field1 from=Field1
fromIndex=collection1}Field2:12010340

Now, I want to collect the faceting information for collection1 with the
same type of query but no data.
So what is needed is -
Query on collection1, match few columns with some expression and then do
JOIN across collection3 do INNER JOIN as above.

Could you help on this?




--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR JOIN

Posted by Erick Erickson <er...@gmail.com>.
How are you trying to do this? Streaming Expressions? ParallelSQL? What _Solr_ constructs are you planning on using?

Best,
Erick

> On Jun 12, 2019, at 7:33 AM, Paresh <kh...@gmail.com> wrote:
> 
> Hi,
> 
> I have two collections both having different schema.
> Collection1: ID, Field1, Field2
> Collection3: ID, Oc1, OC2, col3_Field1
>                 ID1, col3_Oc1
> I want to do following JOINs
> 
> (-)Query on Collection1
> (-)Field2:value2
> (-)JOIN across collection3 Field1 = collection3.col3_Field1
>           Inner JOIN in collection 3
>           col3_oc1 = Oc1
> I am able to achieve SELF JOIN within a collection and across JOIN as well.
> 
> But I am not able do both together.
> 
> Any help appreciated.
> 
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html