Cypher Confusion

24 views
Skip to first unread message

betseyb

unread,
Oct 17, 2012, 4:59:08 PM10/17/12
to ne...@googlegroups.com
I figured out my problems with batch inserting. 

My nodes all have properties Name and Type.  My Relationships all have types.  What I want to do is to be able to find the node(s) with the Name "foo".
From there, I might get all of the nodes that have relationships to "foo", along with their relationships, or add a new relationship between "foo" and another node, or some other task.

I turned on auto indexing on both Name and Type, but can't figure out how to query against it using cypher.  I'm going to be doing all of this via the REST API, but for now I'm using the web console to debug my cypher queries.  Your help is greatly appreciated!


Max De Marzi Jr.

unread,
Oct 17, 2012, 6:11:22 PM10/17/12
to ne...@googlegroups.com
START me = node:node_auto_index(name="max")
RETURN me

betseyb

unread,
Oct 18, 2012, 9:05:13 AM10/18/12
to ne...@googlegroups.com
Thanks.  I tried that, and I get the error "Index 'node_auto_index' does not exist.  The auto-index is on in my neo4j.properties file, do I need to include it in the batch properties as well?

I'm finding this all quite overwhelming.

Peter Neubauer

unread,
Oct 18, 2012, 9:28:43 AM10/18/12
to ne...@googlegroups.com
Hi there,
look at the following code that I just added to the tests in order to
demonstrate the behavior: The Batchinserter has no knowledge of
autoindexing, but you can just create the index with the name
node_auto_index and it will be reused in your configured normal
instance:



https://gist.github.com/3911804


Does that work for you?

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html
> --
>
>

Peter Neubauer

unread,
Oct 18, 2012, 10:06:58 AM10/18/12
to ne...@googlegroups.com
And,
it is now part of the code base at
https://github.com/neo4j/community/blob/b59e0ef0a3ece6f6e761cc8229c1ae83a8d7d340/lucene-index/src/test/java/org/neo4j/unsafe/batchinsert/TestLuceneBatchInsert.java#L318

so you can compile it yourself.

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Neo4j 1.8 GA - http://www.dzone.com/links/neo4j_18_release_fluent_graph_literacy.html


betseyb

unread,
Oct 18, 2012, 11:28:22 AM10/18/12
to ne...@googlegroups.com
Thank you, I have it working now!
Reply all
Reply to author
Forward
0 new messages