Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is not a direct solution to your question, but since I was running into a similar problem, my work-around might be interesting for you.</p> <p>What I need to do is: get relationships by index (might yield many thousands) and get the start node of these. Since the start node is always the same with that index-query, I only need the very first relationship's startnode.</p> <p>Since I wasn't able to achieve that with cypher (the proposed query by ean5533 does not perform any better), I am using a simple <a href="http://docs.neo4j.org/chunked/stable/server-unmanaged-extensions.html" rel="nofollow">unmanaged extension</a> (<a href="https://github.com/dmontag/neo4j-unmanaged-extension-template" rel="nofollow">nice template</a>).</p> <pre><code>@GET @Path("/address/{address}") public Response getUniqueIDofSenderAddress(@PathParam("address") String addr, @Context GraphDatabaseService graphDB) throws IOException { try { RelationshipIndex index = graphDB.index().forRelationships("transactions"); IndexHits&lt;Relationship&gt; rels = index.get("sender_address", addr); int unique_id = -1; for (Relationship rel : rels) { Node sender = rel.getStartNode(); unique_id = (Integer) sender.getProperty("unique_id"); rels.close(); break; } return Response.ok().entity("Unique ID: " + unique_id).build(); } catch (Exception e) { return Response.serverError().entity("Could not get unique ID.").build(); } } </code></pre> <p>For this case here, the speed up is quite nice.</p> <p>I don't know your exact use case, but since Neo4j even supports HTTP streaming afaik, you should be able to create to convert your query to an unmanaged extension and still get the full performance. E.g., "java-querying" all your qualifying nodes and emit the partial result to the HTTP stream.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload