Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

vrindavda
Hello,
I have two collections and need to join the results on uniqueIds.

I am able to do that with Streaming Expressions- LeftOuterJoin. Is there any way to use facets along with this?

Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

Joel Bernstein
If you need to aggregate after the join then you'll need to use the
rollup() function.

The rollup function requires the tuples be sorted by the group by fields.
So it's easiest to accomplish this using the hashOuterJoin, which doesn't
require a sort on the join keys.

If you're doing a parallel join, you'll need to wrap the rollup() around
the parallel() function unless the partionKeys for the join are the same as
the rollup group by.

Here is the psuedo code for a non-parallel join then rollup:

rollup(hashOuterJoin(search(), search()))

Here is the psuedo code for parallel join then rollup:

rollup(parallel(outerHashJoin(search(),search())


In both cases the searches should be sorted by the rollup() group by
fields. In the parallel case, the partitionKeys need to be the join keys.








Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Aug 5, 2016 at 7:21 AM, vrindavda <[hidden email]> wrote:

> Hello,
> I have two collections and need to join the results on uniqueIds.
>
> I am able to do that with Streaming Expressions- LeftOuterJoin. Is there
> any
> way to use facets along with this?
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-6-Use-facet-with-Streaming-Expressions-
> LeftOuterJoin-tp4290526.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

vrindavda
In reply to this post by vrindavda
Hey Joel,

Thanks for you quick response, I was able to merge documents using OutherHashJoin. But I am not able to use rollup() to get count(*) for multiple fields, as we get using facets.

Please suggest if last option is to merge documents using atomic updates, and then use facets(or json.facet). Is there any other way to merge documents permanently ?

Thank you,
Vrinda Davda
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

Joel Bernstein
What issue were you having with the rollup() function?

Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Aug 12, 2016 at 5:01 AM, vrindavda <[hidden email]> wrote:

> Hey Joel,
>
> Thanks for you quick response, I was able to merge documents using
> OutherHashJoin. But I am not able to use rollup() to get count(*) for
> multiple fields, as we get using facets.
>
> Please suggest if last option is to merge documents using atomic updates,
> and then use facets(or json.facet). Is there any other way to merge
> documents permanently ?
>
> Thank you,
> Vrinda Davda
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-6-Use-facet-with-Streaming-Expressions-LeftOuterJoin-
> tp4290526p4291397.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

vrindavda
I am not able to get count(*) for more than one field
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

Joel Bernstein
Ah, the documentation is not clear on this. We need to fix that.

The rollup() function supports multi-dimension aggregations like the facet
expression. You just provide a comma delimited list of fields in the over
parameter:

over="a,b,c"

You will need to sort the underlying stream by those fields well.

sort="a asc, b asc, c asc"






Joel Bernstein
http://joelsolr.blogspot.com/

On Thu, Aug 18, 2016 at 5:42 AM, vrindavda <[hidden email]> wrote:

> I am not able to get count(*) for more than one field
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-6-Use-facet-with-Streaming-Expressions-LeftOuterJoin-
> tp4290526p4292208.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

vrindavda
This post has NOT been accepted by the mailing list yet.

Thanks again. Will try this n follow up.


On 18 Aug 2016 7:10 p.m., "Joel Bernstein [via Lucene]" <[hidden email]> wrote:
Ah, the documentation is not clear on this. We need to fix that.

The rollup() function supports multi-dimension aggregations like the facet
expression. You just provide a comma delimited list of fields in the over
parameter:

over="a,b,c"

You will need to sort the underlying stream by those fields well.

sort="a asc, b asc, c asc"






Joel Bernstein
http://joelsolr.blogspot.com/

On Thu, Aug 18, 2016 at 5:42 AM, vrindavda <[hidden email]> wrote:

> I am not able to get count(*) for more than one field
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Solr-6-Use-facet-with-Streaming-Expressions-LeftOuterJoin-
> tp4290526p4292208.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



If you reply to this email, your message will be added to the discussion below:
http://lucene.472066.n3.nabble.com/Solr-6-Use-facet-with-Streaming-Expressions-LeftOuterJoin-tp4290526p4292238.html
To unsubscribe from Solr 6: Use facet with Streaming Expressions- LeftOuterJoin, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Solr 6: Use facet with Streaming Expressions- LeftOuterJoin

vrindavda
In reply to this post by Joel Bernstein
Thanks again !

I will try this and followup.