Re: Explode kind of function in Solr

2018-09-17 Thread Rushikesh Garadade
@joels...@gmail.com
Thanks for the reply. This is what I want.
However My current implementation is with Spring boot Solr, I did not find
catesianProduct implementation in sping boot.

Please let me know in case if you know anything around "impementaion of
cartesianProduct in spring data.

Thanks,
Rushikesh Garadade

On Thu, Sep 13, 2018 at 6:48 PM Joel Bernstein  wrote:

> Solr Streaming Expressions allow you to do this with the cartesianProduct
> function:
>
>
> http://lucene.apache.org/solr/guide/7_4/stream-decorator-reference.html#cartesianproduct
>
> The structure of the expression is:
>
> cartesianProduct(search(...))
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Thu, Sep 13, 2018 at 6:21 AM Rushikesh Garadade <
> rushikeshgarad...@gmail.com> wrote:
>
> > Hello All,
> > Is there any functionality in solr that can convert (explode) results
> from
> > 1 document to many docuement.
> > *Example: *
> > Lets say I have doc:
> > {
> > id:1,
> > phone: [11,22,33]
> > }
> >
> > when I query to solr with id=1 I want result as below:
> > [{
> > id:1,
> > phone:11
> > },
> > {
> > id:1,
> > phone:22
> > },
> > {
> > d:1,
> > phone:33
> > }]
> >
> > Please let me know if this is possible in Solr , if Yes how?
> >
> > Thanks,
> > Rushikesh Garadade
> >
>


Re: Explode kind of function in Solr

2018-09-14 Thread Rahul Singh
https://github.com/bazaarvoice/jolt

On Thu, Sep 13, 2018 at 9:18 AM Joel Bernstein  wrote:

> Solr Streaming Expressions allow you to do this with the cartesianProduct
> function:
>
>
> http://lucene.apache.org/solr/guide/7_4/stream-decorator-reference.html#cartesianproduct
>
> The structure of the expression is:
>
> cartesianProduct(search(...))
>
>
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Thu, Sep 13, 2018 at 6:21 AM Rushikesh Garadade <
> rushikeshgarad...@gmail.com> wrote:
>
> > Hello All,
> > Is there any functionality in solr that can convert (explode) results
> from
> > 1 document to many docuement.
> > *Example: *
> > Lets say I have doc:
> > {
> > id:1,
> > phone: [11,22,33]
> > }
> >
> > when I query to solr with id=1 I want result as below:
> > [{
> > id:1,
> > phone:11
> > },
> > {
> > id:1,
> > phone:22
> > },
> > {
> > d:1,
> > phone:33
> > }]
> >
> > Please let me know if this is possible in Solr , if Yes how?
> >
> > Thanks,
> > Rushikesh Garadade
> >
>


Re: Explode kind of function in Solr

2018-09-13 Thread Joel Bernstein
Solr Streaming Expressions allow you to do this with the cartesianProduct
function:

http://lucene.apache.org/solr/guide/7_4/stream-decorator-reference.html#cartesianproduct

The structure of the expression is:

cartesianProduct(search(...))



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


On Thu, Sep 13, 2018 at 6:21 AM Rushikesh Garadade <
rushikeshgarad...@gmail.com> wrote:

> Hello All,
> Is there any functionality in solr that can convert (explode) results from
> 1 document to many docuement.
> *Example: *
> Lets say I have doc:
> {
> id:1,
> phone: [11,22,33]
> }
>
> when I query to solr with id=1 I want result as below:
> [{
> id:1,
> phone:11
> },
> {
> id:1,
> phone:22
> },
> {
> d:1,
> phone:33
> }]
>
> Please let me know if this is possible in Solr , if Yes how?
>
> Thanks,
> Rushikesh Garadade
>


Re: Explode kind of function in Solr

2018-09-13 Thread Andrea Gazzarini

Hi,
as far as I know, this is not possible. Solr is document-oriented, 
meaning with that its datamodel works using a "document" level of 
granularity. If you index A, you get A.

I see a couple of chances (maybe someone else could add other options):

 * index exactly what you need: in your case I would index *3 docs*
   with a grouping criteria *"1"* (it is your current id, which cannot
   be an id in this case)
 * index 1 document with multivalued "phone" id (like in your example),
   and have an intermediate API layer or directly the frontend which
   "expands" the result as you want.

Best,
Andrea

On 13/09/18 12:20, Rushikesh Garadade wrote:

Hello All,
Is there any functionality in solr that can convert (explode) results from
1 document to many docuement.
*Example: *
Lets say I have doc:
{
id:1,
phone: [11,22,33]
}

when I query to solr with id=1 I want result as below:
[{
id:1,
phone:11
},
{
id:1,
phone:22
},
{
d:1,
phone:33
}]

Please let me know if this is possible in Solr , if Yes how?

Thanks,
Rushikesh Garadade





Explode kind of function in Solr

2018-09-13 Thread Rushikesh Garadade
Hello All,
Is there any functionality in solr that can convert (explode) results from
1 document to many docuement.
*Example: *
Lets say I have doc:
{
id:1,
phone: [11,22,33]
}

when I query to solr with id=1 I want result as below:
[{
id:1,
phone:11
},
{
id:1,
phone:22
},
{
d:1,
phone:33
}]

Please let me know if this is possible in Solr , if Yes how?

Thanks,
Rushikesh Garadade