Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:18:54+00:00 2026-06-02T01:18:54+00:00

I have a graph in Neo4j in which nodes represent random points in the

  • 0

I have a graph in Neo4j in which nodes represent random points in the plane, each node having the coordinates stored as properties (x and y, the value type is double).
I create the nodes and index them:

    IndexManager index = graph.index();
    Index<Node> nodesIndex = index.forNodes("points");

    for (int i = 0; i < points.length; i++) {
        Point p = points[i]; 
        Node n;

        Transaction tx = graph.beginTx();
        try {
            n = graph.createNode();
            n.setProperty("x", p.getX());
            n.setProperty("y", p.getY());

            nodesIndex.add(n, "x", new ValueContext(p.getX()).indexNumeric());
            nodesIndex.add(n, "y", new ValueContext(p.getY()).indexNumeric());

            tx.success();
        } finally {
            tx.finish();
        }
    }

Now, what I need to do, is query for the nodes which are in a square area. So for example I made this query:

http://localhost:7474/db/data/index/node/points?query=x:[0.0 TO 3.0] AND y:[0.0 TO 3.0]

And this is the response:

    Node
    Properties
    y   1.0
    x   14.0
    Node info
    self    /db/data/node/10

    Node
    Properties
    y   1.0
    x   2.0
    Node info
    self    /db/data/node/7

    Node
    Properties
    y   1.0
    x   6.0
    Node info
    self    /db/data/node/8

    Node
    Properties
    y   1.0
    x   7.0
    Node info
    self    /db/data/node/9

[Etc...]

As you see it is not working. And I don’t understand why (maybe I need to configure the index?).
Note that I haven’t got to use Lucene. If there is a way to gather that information with Cypher (starting from a node centered in the square area) would be actually better, for I also need the relationships between the nodes found.

Additional informations
If that matters, the graph represents a Delaunay triangolation on a random set of points on the plane. In more abstract terms, I need to “extract” the entire subgraph that lays in a given area.

Any help is really appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:18:55+00:00Added an answer on June 2, 2026 at 1:18 am

    I am afraid you can’t do this via Cypher. There is no way Cypher can infer that you want to use a numeric Value context for this query (could probably be in some indexing meta info in future releases), and you need that to be able to query Lucene the way you want to. Easiest way over REST is probably to use Groovy, see custom sorting (same issue) at http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-send-an-arbitrary-groovy-script—lucene-sorting

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a graph which is essentially an ArrayList of Nodes, each of which
I have a graph which I would like to represent using an image on
I have a graph with n nodes as an adjacency matrix . Is it
I have a graph which contains an unknown number of disconnected subgraphs. What's a
I have a graph plotted using Floa Graph Lib, and x-axis has 30 points
I have undirected graph with 57 nodes and 204 linkages. I calculate the shortest
I have created a graph component in AS3 which extends UIComponent. I created an
I am having problems with indexing/persisting with SDN 2.0.0.RELEASE and Neo4j 1.5. I have
I have a graph which I traverse using a typical visitor pattern. I've run
I have a graph on neo4j and I would like to run a topological

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.