0
votes

I have created and indexed my graph database through localhost:7474 in neo4j(visually).

The Nodes have three properties,name,priority,link.

and I created index on name property of nodes through

add or remove indexes

tab of localhost:7474(as shown in picture)enter image description here

but when I try to retrieve nodes based on their names,in data browser,console,or my java application the nodes can not be found.

in console or data browser,when I write this query for red(there is a node with the name of red),for example:

start n=node:name(name="red")
return n; 

I get returned 0 rows.

and when I type this query:

start n=node:node(name="red")
return n;

or this one:

start n=node:Node(name="red")
return n;

I get Indexnodedoes not exist,IndexNodedoes not exist,in console or data browser.

my database file is in the same path which neo4j default.graphdb file exists(I mean in "C:\Users\fereshteh\Documents\Neo4j" ),and I first created the index,and then the graph database.

I don't know what I am doing wrong,please help me,I will be so thankful.

version of neo4j:1.9.4

1
Which version of Neo4j are you using?Nicholas
what should I do Nicholas?fereshteh

1 Answers

1
votes

I believe your assumption about how to set up the indexing is incorrect. You can read here for more information, but basically there are 3 things that are needed to create/read from an index. The Index name, the entry key, and the entry value.

What you have specified above in the Web Console is the Index name, but in your cypher query, you are specifying the entry key. You either want to use the Node Auto index, or to create a node in cypher and index it there but that isn't an option in 1.9.4.