lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmed Adel <aa.0...@gmail.com>
Subject Re: Returning multiple fields in /graph streaming expression response
Date Tue, 23 Jul 2019 10:24:47 GMT
Wrapping the expression in a fetch function as follows works:

fetch(names, select(nodes(enron_emails,
  nodes(enron_emails,
walk="kayne.coulter@enron.com->from",
      trackTraversal="true",
gather="to"),                                  walk="node->from",
                            scatter="leaves,branches",
                 trackTraversal="true",
  gather="to"), node as from), fl="name", on="from")


however, the response loses some of its structure and no edges are
returned, i.e. it becomes:

<?xml version="1.0" encoding="UTF-8"?>

<graphml xmlns="http://graphml.graphdrawing.org/xmlns"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">

<graph id="G" edgedefault="directed">

  <node id="null">

    <data key="from">kayne.coulter@enron.com</data>

    <data key="name">Kayne Coulter</data>

  </node>

  <node id="null">

    <data key="from">randal.maffett@enron.com</data>

    <data key="name">Randal Maffett</data>

  </node>

...

</graph>

which can be used as a subsequent request to the first in order to retrieve
additional fields but it would be more efficient if there's a way to
retrieve the required fields in one request.

Best,
A. Adel

On Mon, Jul 22, 2019 at 4:00 PM Ahmed Adel <aa.0x7f@gmail.com> wrote:

> Hi,
>
> Similar to this question (
> https://mail-archives.apache.org/mod_mbox/lucene-solr-user/201907.mbox/browser),
> how can additional fields be returned when using /graph request handler?
>
> For example, from the documentation, for the request:
>
> nodes(enron_emails,                                  nodes(enron_emails,            
                           walk="kayne.coulter@enron.com->from",                      
                 trackTraversal="true",                                        gather="to"),
                                 walk="node->from",                                  scatter="leaves,branches",
                                 trackTraversal="true",                                  gather="to")
>
>
> is there a way to add more fields to the response:
>
> <graphml xmlns="http://graphml.graphdrawing.org/xmlns"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd"><graph id="G" edgedefault="directed">
>      <node id="kayne.coulter@enron.com">
>            <data key="field">node</data>
>            <data key="level">0</data>
>            <data key="count(*)">0.0</data>
>      </node>
>      <node id="don.baughman@enron.com">
>            <data key="field">to</data>
>            <data key="level">1</data>
>            <data key="count(*)">1.0</data>
>      </node>
>      <edge id="1"  source="kayne.coulter@enron.com"  target="don.baughman@enron.com"/>
>      <node id="john.kinser@enron.com">
>            <data key="field">to</data>
>            <data key="level">1</data>
>            <data key="count(*)">1.0</data>
>     </node>
>     <edge id="2"  source="kayne.coulter@enron.com"  target="john.kinser@enron.com"/>
>     <node id="jay.wills@enron.com">
>           <data key="field">to</data>
>           <data key="level">1</data>
>           <data key="count(*)">1.0</data>
>     </node>
>     <edge id="3"  source="kayne.coulter@enron.com"  target="jay.wills@enron.com"/></graph></graphml>
>
>
> Best,
> A. Adel
> http://aadel.io
>

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