lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: Graph Traversal Question
Date Wed, 26 Oct 2016 11:13:51 GMT
On Tue, Oct 25, 2016 at 6:26 PM Yonik Seeley <yseeley@gmail.com> wrote:

> You can get the nodes that to came from by adding trackTraversal=true
>

Yeah, I've tried that.  It's not quite what I want.  That just gets me the
"subject".

What I'm trying to do is more akin to what a triple store does.

I _can_ do things like filter on the relationship, which is a good start,
but I want the relationship and the object together so that I can do
downstream work on it.

In your example below it would be akin to injecting the rating onto those
responses as well, not just in the 'fq'.


>
> A cut'n'paste example from my Lucene/Solr Revolution slides:
>
> curl $URL -d 'expr=gatherNodes(reviews,
>    search(reviews, q="user_s:Yonik AND rating_i:5",
>           fl="book_s,user_s,rating_i",sort="user_s asc"),
>    walk="book_s->book_s",
>    gather="user_s",
>    fq="rating_i:[4 TO *] -user_s:Yonik",
>    trackTraversal=true )'
>
> {"result-set":{"docs":[
>
> {"node":"Haruka","collection":"reviews","field":"user_s","ancestors":["book1"],"level":1},
>
> {"node":"Maria","collection":"reviews","field":"user_s","ancestors":["book2"],"level":1},
> {"EOF":true,"RESPONSE_TIME":22}]}}
>
> -Yonik
>
>
> On Tue, Oct 25, 2016 at 5:57 PM, Grant Ingersoll <gsingers@apache.org>
> wrote:
> > Hi,
> >
> > I'm playing around with the new Graph Traversal/GatherNodes capabilities
> in
> > Solr 6.  I've been indexing Yago facts (
> >
> http://www.mpi-inf.mpg.de/departments/databases-and-information-systems/research/yago-naga/yago/downloads/
> )
> > which give me triples of something like subject-relationship-object
> (United
> > States -> hasCapital -> Washington DC)
> >
> > My documents look like:
> > subject: string
> > relationship: string
> > object: string
> >
> > I can do a simple gatherNodes like
> > http://localhost:8983/solr/default/graph?expr=gatherNodes(default,
> > walk="United_States->subject", gather="object") and get back the objects
> > that relate to the subject.  However, I don't see any way to capture what
> > the relationship is in the response.  IOW, the request above would just
> > return a node of "Washington DC", but it doesn't tell me the relationship
> > (i.e. I'd like to get Wash DC and hasCapital back somehow).  Is there
> > anyway to expand the "gather" or otherwise mark up the nodes returned
> with
> > additional field attributes or maybe get additional graph info back?
> >
> > Thanks,
> > Grant
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message