AJN
AJN

Reputation: 1206

regex search works with cypher parser 1.9 not with version 2

I followed http://docs.neo4j.org/refcard/2.0/ for search using regular expression, it looks like Cypher2 has a problem with the operator "=~" it works for cypher parser 1.9 but not with version 2

==> http://console.neo4j.org/

Query:
CYPHER 1.9  START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n

result=OK

Doesn't work after switching to cypher parser 2:

Query:
START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n
Error: java.lang.ClassCastException: org.neo4j.cypher.internal.compiler.v1_9.commands.Query cannot be cast to org.neo4j.cypher.internal.compiler.v2_0.commands.AbstractQuery

==> Neo4j 2.0.0-M06

START n=node(*)
WHERE n.name =~ 's.*' 
RETURN n  

Expected 2 to be a java.lang.String, but it was a java.lang.Integer
STATEMENT_EXECUTION_ERROR

Any hint?

Upvotes: 0

Views: 365

Answers (1)

Peter Neubauer
Peter Neubauer

Reputation: 6331

The console is now updated and working with the regexp for Neo4j 2.0 again, see http://console.neo4j.org/r/dcizjv

START n=node(*) 
WHERE n.name =~ 'T.*' 
RETURN n

Upvotes: 2

Related Questions