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 Gintautas Sulskus <gi...@gmail.com> on 2018/02/04 20:12:44 UTC

using gatherNodes to produce 'to' -> 'from' pairs

Hi,

By default, gatherNodes returns only a set of 'to' nodes.
Is there a neat way to return a set of all maplets 'from' -> 'to'?


Thanks,
Gin

Re: using gatherNodes to produce 'to' -> 'from' pairs

Posted by Joel Bernstein <jo...@gmail.com>.
There is traceability built in also, but I'm not sure if it provides enough
features for your use case.

In the docs you'll see there is a trackTraversal flag which outputs the
ancestors that point to each node as an array. You can use the
cartesianProduct() expression to expand the ancestors array into tuples and
fetch using the ancestors node IDs.




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

On Mon, Feb 5, 2018 at 5:20 AM, Gintautas Sulskus <
gintautas.sulskus@gmail.com> wrote:

> Hi Joel,
>
> Thanks. The alternatives will not be as neat, unfortunately.
>
> fetch() does not suit the needs because it cannot trace back the root node
> given only the 'from' value.
> The node pairs below would produce a result set of {'b1', 'b2', 'b1'} and
> there is no way to tell which root element they correspond to.
>
> 'from' - 'to'
>     a1 -> b1
>     a1 -> b2
>     a2 -> b1
>
>
> Best,
> Gintas
>
> On Sun, Feb 4, 2018 at 11:36 PM, Joel Bernstein <jo...@gmail.com>
> wrote:
>
> > Currently you can only directly gather nodes and aggregations. The
> fetch()
> > expression can be used to fetch more fields if needed in a secondary
> call.
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> > On Sun, Feb 4, 2018 at 3:12 PM, Gintautas Sulskus <
> > gintautas.sulskus@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > By default, gatherNodes returns only a set of 'to' nodes.
> > > Is there a neat way to return a set of all maplets 'from' -> 'to'?
> > >
> > >
> > > Thanks,
> > > Gin
> > >
> >
>

Re: using gatherNodes to produce 'to' -> 'from' pairs

Posted by Gintautas Sulskus <gi...@gmail.com>.
Hi Joel,

Thanks. The alternatives will not be as neat, unfortunately.

fetch() does not suit the needs because it cannot trace back the root node
given only the 'from' value.
The node pairs below would produce a result set of {'b1', 'b2', 'b1'} and
there is no way to tell which root element they correspond to.

'from' - 'to'
    a1 -> b1
    a1 -> b2
    a2 -> b1


Best,
Gintas

On Sun, Feb 4, 2018 at 11:36 PM, Joel Bernstein <jo...@gmail.com> wrote:

> Currently you can only directly gather nodes and aggregations. The fetch()
> expression can be used to fetch more fields if needed in a secondary call.
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Sun, Feb 4, 2018 at 3:12 PM, Gintautas Sulskus <
> gintautas.sulskus@gmail.com> wrote:
>
> > Hi,
> >
> > By default, gatherNodes returns only a set of 'to' nodes.
> > Is there a neat way to return a set of all maplets 'from' -> 'to'?
> >
> >
> > Thanks,
> > Gin
> >
>

Re: using gatherNodes to produce 'to' -> 'from' pairs

Posted by Joel Bernstein <jo...@gmail.com>.
Currently you can only directly gather nodes and aggregations. The fetch()
expression can be used to fetch more fields if needed in a secondary call.

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

On Sun, Feb 4, 2018 at 3:12 PM, Gintautas Sulskus <
gintautas.sulskus@gmail.com> wrote:

> Hi,
>
> By default, gatherNodes returns only a set of 'to' nodes.
> Is there a neat way to return a set of all maplets 'from' -> 'to'?
>
>
> Thanks,
> Gin
>