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 Karthik Ramachandran <mr...@gmail.com> on 2018/01/14 16:47:04 UTC

Streaming Expressions shortestPath

Can shortestPath stream source be used with fetch?

With below streaming expression, we only get the path, are we doing
something wrong here?

fetch(collection,
      shortestPath(collection, from="10", to="1", edge="id=parentid",
maxDepth="10"),
      fl="id, name, other, details",
      sort="name asc"
      on="id=id")

With Thanks & Regards
Karthik Ramachandran

P Please don't print this e-mail unless you really need to

Re: Streaming Expressions shortestPath

Posted by Karthik Ramachandran <mr...@gmail.com>.
Joel,
  Should I create a JIRA for making shortestPath return stream of tuples?

On Sun, Jan 14, 2018 at 11:52 PM, Karthik Ramachandran <mr...@gmail.com>
wrote:

> Joel,
>   Thanks, I did try using cartesianProduct then fetch, it is working as
> excepted. For my dataset has only 5 or 6 level for that shortestPath
> response time is ~5 sec and with cartesianProduct and fetch I am getting
> ~6.5 sec.  Is there any other way to achieve this?
>
> For my use case graph query did work well but with SolrCloud, there is no
> guarantee that all the nodes will in the same shard.
>
> On Sun, Jan 14, 2018 at 8:20 PM, Joel Bernstein <jo...@gmail.com>
> wrote:
>
>> Actually I think you can achieve what you're looking for by using the
>> cartesianProduct expression around the shortest expression. The construct
>> would look like this:
>>
>> fetch(cartesianProduct(shortesPath()))
>>
>> The link below describes how the cartesianProduct expression works:
>> https://lucene.apache.org/solr/guide/7_2/stream-decorator-
>> reference.html#cartesianproduct
>>
>> Joel Bernstein
>> http://joelsolr.blogspot.com/
>>
>> On Sun, Jan 14, 2018 at 8:07 PM, Joel Bernstein <jo...@gmail.com>
>> wrote:
>>
>> > The shortestPath returns a list of node id's, and fetch expects a stream
>> > of tuples. So they are not compatible currently. It think makes sense to
>> > change shortestPath to return a stream of tuples so it can work with
>> fetch
>> > and other expressions.
>> >
>> > Are you getting good performance with the shortestPath expression?
>> >
>> > Joel Bernstein
>> > http://joelsolr.blogspot.com/
>> >
>> > On Sun, Jan 14, 2018 at 11:47 AM, Karthik Ramachandran <
>> mrktve@gmail.com>
>> > wrote:
>> >
>> >> Can shortestPath stream source be used with fetch?
>> >>
>> >> With below streaming expression, we only get the path, are we doing
>> >> something wrong here?
>> >>
>> >> fetch(collection,
>> >>       shortestPath(collection, from="10", to="1", edge="id=parentid",
>> >> maxDepth="10"),
>> >>       fl="id, name, other, details",
>> >>       sort="name asc"
>> >>       on="id=id")
>> >>
>> >> With Thanks & Regards
>> >> Karthik Ramachandran
>> >>
>> >> P Please don't print this e-mail unless you really need to
>> >>
>> >
>> >
>>
>
>
>
> --
> With Thanks & Regards
> Karthik Ramachandran
>
> P Please don't print this e-mail unless you really need to
>
>
>



-- 
With Thanks & Regards
Karthik Ramachandran

P Please don't print this e-mail unless you really need to

Re: Streaming Expressions shortestPath

Posted by Karthik Ramachandran <mr...@gmail.com>.
Joel,
  Thanks, I did try using cartesianProduct then fetch, it is working as
excepted. For my dataset has only 5 or 6 level for that shortestPath
response time is ~5 sec and with cartesianProduct and fetch I am getting
~6.5 sec.  Is there any other way to achieve this?

For my use case graph query did work well but with SolrCloud, there is no
guarantee that all the nodes will in the same shard.

On Sun, Jan 14, 2018 at 8:20 PM, Joel Bernstein <jo...@gmail.com> wrote:

> Actually I think you can achieve what you're looking for by using the
> cartesianProduct expression around the shortest expression. The construct
> would look like this:
>
> fetch(cartesianProduct(shortesPath()))
>
> The link below describes how the cartesianProduct expression works:
> https://lucene.apache.org/solr/guide/7_2/stream-decorator-reference.html#
> cartesianproduct
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Sun, Jan 14, 2018 at 8:07 PM, Joel Bernstein <jo...@gmail.com>
> wrote:
>
> > The shortestPath returns a list of node id's, and fetch expects a stream
> > of tuples. So they are not compatible currently. It think makes sense to
> > change shortestPath to return a stream of tuples so it can work with
> fetch
> > and other expressions.
> >
> > Are you getting good performance with the shortestPath expression?
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> > On Sun, Jan 14, 2018 at 11:47 AM, Karthik Ramachandran <mrktve@gmail.com
> >
> > wrote:
> >
> >> Can shortestPath stream source be used with fetch?
> >>
> >> With below streaming expression, we only get the path, are we doing
> >> something wrong here?
> >>
> >> fetch(collection,
> >>       shortestPath(collection, from="10", to="1", edge="id=parentid",
> >> maxDepth="10"),
> >>       fl="id, name, other, details",
> >>       sort="name asc"
> >>       on="id=id")
> >>
> >> With Thanks & Regards
> >> Karthik Ramachandran
> >>
> >> P Please don't print this e-mail unless you really need to
> >>
> >
> >
>



-- 
With Thanks & Regards
Karthik Ramachandran

P Please don't print this e-mail unless you really need to

Re: Streaming Expressions shortestPath

Posted by Joel Bernstein <jo...@gmail.com>.
Actually I think you can achieve what you're looking for by using the
cartesianProduct expression around the shortest expression. The construct
would look like this:

fetch(cartesianProduct(shortesPath()))

The link below describes how the cartesianProduct expression works:
https://lucene.apache.org/solr/guide/7_2/stream-decorator-reference.html#cartesianproduct

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

On Sun, Jan 14, 2018 at 8:07 PM, Joel Bernstein <jo...@gmail.com> wrote:

> The shortestPath returns a list of node id's, and fetch expects a stream
> of tuples. So they are not compatible currently. It think makes sense to
> change shortestPath to return a stream of tuples so it can work with fetch
> and other expressions.
>
> Are you getting good performance with the shortestPath expression?
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
> On Sun, Jan 14, 2018 at 11:47 AM, Karthik Ramachandran <mr...@gmail.com>
> wrote:
>
>> Can shortestPath stream source be used with fetch?
>>
>> With below streaming expression, we only get the path, are we doing
>> something wrong here?
>>
>> fetch(collection,
>>       shortestPath(collection, from="10", to="1", edge="id=parentid",
>> maxDepth="10"),
>>       fl="id, name, other, details",
>>       sort="name asc"
>>       on="id=id")
>>
>> With Thanks & Regards
>> Karthik Ramachandran
>>
>> P Please don't print this e-mail unless you really need to
>>
>
>

Re: Streaming Expressions shortestPath

Posted by Joel Bernstein <jo...@gmail.com>.
The shortestPath returns a list of node id's, and fetch expects a stream of
tuples. So they are not compatible currently. It think makes sense to
change shortestPath to return a stream of tuples so it can work with fetch
and other expressions.

Are you getting good performance with the shortestPath expression?

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

On Sun, Jan 14, 2018 at 11:47 AM, Karthik Ramachandran <mr...@gmail.com>
wrote:

> Can shortestPath stream source be used with fetch?
>
> With below streaming expression, we only get the path, are we doing
> something wrong here?
>
> fetch(collection,
>       shortestPath(collection, from="10", to="1", edge="id=parentid",
> maxDepth="10"),
>       fl="id, name, other, details",
>       sort="name asc"
>       on="id=id")
>
> With Thanks & Regards
> Karthik Ramachandran
>
> P Please don't print this e-mail unless you really need to
>