2
votes

Since version 2.0, Neo4j has a preferred way for index creation : http://docs.neo4j.org/chunked/milestone/rest-api-schema-indexes.html

Following the documentation, I was able to easily create an index named "node" on the "label" node property.

Now, I have two questions :

(1) Index creation can take some time to run on large graphs. How can I now when the indexing process is done ? (It is mention in the documentation, but they don't say how they do it)

You can check the status of your index by listing all the indexes for the relevant label. The created index will show up, but have a state of POPULATING until the index is ready, where it is marked as ONLINE.

(2) How can I query, using the REST API (not Cypher) and the newly created index, to get the set of nodes matching a pattern, using the newly created index. For example :

curl -X GET -H "Accept: application/json" http://localhost:17474/db/data/schema/index/node/?query=label:Energy

Thanks

1

1 Answers

0
votes
  1. You can check with the :schema command in the browser, it will then show up as being "ONLINE", from that moment on the updates to the index will happen transactionally with your graph data.

  2. Why don't you want to use Cypher? You would use this endpoint, which returns nodes by label and property.