Combine Results with Two different Collections.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Combine Results with Two different Collections.

Fiz Ahmed
Hi Team,

Could you please let me know how to handle the below scenario.

I have Two Collections  *Accounts & Content.*

I am trying to search term *"biodata". *

from Accounts Collections I am getting the output   *sample : your biodata*

from Content Collections I am getting the output  *title : my biodata*

*how to combine these Two results against 2 different collection and
get the results .  can you let me know sample solr query to run ? *

Your help is much appreciated.


Thanks
Fiz.
Reply | Threaded
Open this post in threaded view
|

Re: Combine Results with Two different Collections.

Mikhail Khludnev-2
I believe it supports collection=accounts,content param, but can't find it
in documentation.

On Fri, Jan 12, 2018 at 2:27 AM, Fiz Newyorker <[hidden email]> wrote:

> Hi Team,
>
> Could you please let me know how to handle the below scenario.
>
> I have Two Collections  *Accounts & Content.*
>
> I am trying to search term *"biodata". *
>
> from Accounts Collections I am getting the output   *sample : your biodata*
>
> from Content Collections I am getting the output  *title : my biodata*
>
> *how to combine these Two results against 2 different collection and
> get the results .  can you let me know sample solr query to run ? *
>
> Your help is much appreciated.
>
>
> Thanks
> Fiz.
>



--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: Combine Results with Two different Collections.

Fiz Ahmed
Yes Mikhail, even I couldn't find it.

Hi Solr-user team,

Requesting your support.

Thanks
Fiz.

On Thu, Jan 11, 2018 at 8:06 PM, Mikhail Khludnev <[hidden email]> wrote:

> I believe it supports collection=accounts,content param, but can't find it
> in documentation.
>
> On Fri, Jan 12, 2018 at 2:27 AM, Fiz Newyorker <[hidden email]>
> wrote:
>
> > Hi Team,
> >
> > Could you please let me know how to handle the below scenario.
> >
> > I have Two Collections  *Accounts & Content.*
> >
> > I am trying to search term *"biodata". *
> >
> > from Accounts Collections I am getting the output   *sample : your
> biodata*
> >
> > from Content Collections I am getting the output  *title : my biodata*
> >
> > *how to combine these Two results against 2 different collection and
> > get the results .  can you let me know sample solr query to run ? *
> >
> > Your help is much appreciated.
> >
> >
> > Thanks
> > Fiz.
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>
Reply | Threaded
Open this post in threaded view
|

Re: Combine Results with Two different Collections.

Saurabh Suman-2
In reply to this post by Fiz Ahmed
Try using solr streaming api.
https://lucene.apache.org/solr/guide/6_6/streaming-expressions.html
Sample query:
innerJoin(
select(search(<collection 1 name>, q=<collection 1 query>, fl=<collection 1
select fields>, sort=<sort criteria>, qt="/export"), <select field name
with alias >),
select(search(search(<collection 2 name>, q=<collection 2 query>,
fl=<collection 2 select fields>, sort=<sort criteria>, qt="/export"),
<select field name with alias >),
on=<join field>)

Note :  Both collections must have at least one common field to perform the
joining.

On Fri, Jan 12, 2018 at 4:57 AM, Fiz Newyorker <[hidden email]> wrote:

> Hi Team,
>
> Could you please let me know how to handle the below scenario.
>
> I have Two Collections  *Accounts & Content.*
>
> I am trying to search term *"biodata". *
>
> from Accounts Collections I am getting the output   *sample : your biodata*
>
> from Content Collections I am getting the output  *title : my biodata*
>
> *how to combine these Two results against 2 different collection and
> get the results .  can you let me know sample solr query to run ? *
>
> Your help is much appreciated.
>
>
> Thanks
> Fiz.
>



--
Thanks and Regards,
Suman Saurabh
Reply | Threaded
Open this post in threaded view
|

Re: Combine Results with Two different Collections.

Gus Heck
If you just want docs from both collections in the same results, create an
alias across the 2 collections.

https://lucene.apache.org/solr/guide/6_6/collections-api.html

On Thu, Jan 11, 2018 at 11:12 PM, Suman Saurabh <[hidden email]>
wrote:

> Try using solr streaming api.
> https://lucene.apache.org/solr/guide/6_6/streaming-expressions.html
> Sample query:
> innerJoin(
> select(search(<collection 1 name>, q=<collection 1 query>, fl=<collection 1
> select fields>, sort=<sort criteria>, qt="/export"), <select field name
> with alias >),
> select(search(search(<collection 2 name>, q=<collection 2 query>,
> fl=<collection 2 select fields>, sort=<sort criteria>, qt="/export"),
> <select field name with alias >),
> on=<join field>)
>
> Note :  Both collections must have at least one common field to perform the
> joining.
>
> On Fri, Jan 12, 2018 at 4:57 AM, Fiz Newyorker <[hidden email]>
> wrote:
>
> > Hi Team,
> >
> > Could you please let me know how to handle the below scenario.
> >
> > I have Two Collections  *Accounts & Content.*
> >
> > I am trying to search term *"biodata". *
> >
> > from Accounts Collections I am getting the output   *sample : your
> biodata*
> >
> > from Content Collections I am getting the output  *title : my biodata*
> >
> > *how to combine these Two results against 2 different collection and
> > get the results .  can you let me know sample solr query to run ? *
> >
> > Your help is much appreciated.
> >
> >
> > Thanks
> > Fiz.
> >
>
>
>
> --
> Thanks and Regards,
> Suman Saurabh
>



--
http://www.the111shift.com