Diogo
Diogo

Reputation: 548

neo4j cypher index query

I was used to use node_auto_index( condition ) to search for nodes using indexes, but now i used batch-import ( https://github.com/jexp/batch-import/ ) and it created indexes with specific names ( type, code, etc ). So, how to do a cypher query using indexes on multiple properties ?

old query example :

START n = node : node_auto_index( 'type: NODE_TYPE AND code: NODE_CODE' ) RETURN n;

how to do the 'same' query but without node_auto_index and specific index names ?

START n = node : type( "type = NODE_TYPE" ) RETURN n;

Also, the next query does not work (no errors, but the result is empty and it shouldn't be) :

START n = node : type( 'type: NODE_TYPE AND code: NODE_CODE' ) RETURN n;

So, type is an index, code is an index. how to mix the two in the same query for a single node ?

Another question: whats the difference of node_auto_index and this indexes with specific names ?

Thank you.

Upvotes: 0

Views: 924

Answers (1)

Eve Freeman
Eve Freeman

Reputation: 33175

You almost had it:

START n = node:type("type:NODE_TYPE") RETURN n;

or

START n = node:type(type="NODE_TYPE") RETURN n;

Upvotes: 0

Related Questions