Reputation: 3320
public interface WayPointRepository extends GraphRepository, NamedIndexRepository, RelationshipOperationsRepository { @Query( value = "start point=node:waypoints(\"name:{name1}\") return point", elementClass=WayPoint.class, type=QueryType.Cypher ) public List getWayPointByName(@Param("name1") String name); }
i have a neo4j database with some points stored in it with index "waypoints", i want to get some points dynamically after passing some points. for this i have created placeholder {name1},
but on calling the getWayPointByName with dynamic param gives me
nested exception is java.lang.RuntimeException: org.apache.lucene.queryParser.ParseException: Cannot parse 'name:{name1}': Encountered " "}" "} "" at line 1, column 11.
Was expecting one of:
"TO" ...
...
...
] with root cause
org.apache.lucene.queryParser.ParseException: Encountered " "}" "} "" at line 1, column 11.
Was expecting one of:
"TO" ...
...
...
at org.apache.lucene.queryParser.QueryParser.generateParseException(QueryParser.java:1818)
at org.apache.lucene.queryParser.QueryParser.jj_consume_token(QueryParser.java:1700)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:1507)
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1309)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1237)
at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1226)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:206)
exception
Upvotes: 0
Views: 281
Reputation: 41706
Use
start point=node:waypoints(name={name1}) return point
Within strings there is no parameter substitution happening.
Upvotes: 3