Hi,
I'm trying to make this query in a SDN repository:
start g=node:groups("name:*") match u-[b?:belongs]->g<-
[c?:contains*0..8]-p<-[n?:contains]-h where ((u.login AND u.login=~
{query}) OR g.name=~ {query}) and n is null return distinct p order by
p.name skip {from} limit {total}
My code in repository is this:
@Query(value="start g=node:groups(\"name:*\") " +
"match u-[b?:belongs]->g<-[c?:contains*0..8]-p<-[n?:contains]-h " +
"where ((u.login AND u.login=~ {query}) " +
"and n is null " +
"return distinct p " + //, from, total " +
"order by p.name skip {from} limit {total}" )
Iterable<Group> getGroups(
@Param( "query" ) String query,
@Param( "from" ) int from,
@Param( "total" ) int total );
When the query returns results, I get an exception caused by a
parameter not being found:
Caused by: org.neo4j.cypher.ParameterNotFoundException: Expected a
parameter named from
at org.neo4j.cypher.commands.Parameter$$anonfun$apply
$5.apply(Expression.scala:187)
at org.neo4j.cypher.commands.Parameter$$anonfun$apply
$5.apply(Expression.scala:187)
at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:122)
at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:187)
at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:186)
at org.neo4j.cypher.internal.pipes.SlicePipe.asInt$1(SlicePipe.scala:
37)
at
org.neo4j.cypher.internal.pipes.SlicePipe.createResults(SlicePipe.scala:
44)
at
org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilter Pipe.scala:
33)
at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
$prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
$prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
at
org.neo4j.cypher.internal.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala :
33)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55)
at
org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:
78)
at
org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExec uteQuery(CypherQueryEngine.java:
63)
... 98 more
I have debugged it as far as I can and in the step createResults of
the SlicePipe I can see "from" and "total" with the correct values as
params.
My version of neo4j is 1.6.M02.
Do you have any idea about why is this error happening and how to
solve it?
On Wed, May 30, 2012 at 11:08 AM, mrwizard <javi...@gmail.com> wrote:
> My version of neo4j is 1.6.M02.
Looking at http://neo4j.org/download, the latest 1.6 released is 1.6.3. I
suggest that you first try on that version, and then report back if the
issue persists.
Mmh,
the code looks legit. Is there any way you could change the name of
the parameter or try if all the others are working if you remove the
"from" parameter? It looks like there might be a parsing error or so?
> Hi,
> I'm trying to make this query in a SDN repository:
> start g=node:groups("name:*") match u-[b?:belongs]->g<-
> [c?:contains*0..8]-p<-[n?:contains]-h where ((u.login AND u.login=~
> {query}) OR g.name=~ {query}) and n is null return distinct p order by
> p.name skip {from} limit {total}
> My code in repository is this:
> @Query(value="start g=node:groups(\"name:*\") " +
> "match u-[b?:belongs]->g<-[c?:contains*0..8]-p<-[n?:contains]-h " +
> "where ((u.login AND u.login=~ {query}) " +
> "and n is null " +
> "return distinct p " + //, from, total " +
> "order by p.name skip {from} limit {total}" )
> Iterable<Group> getGroups(
> @Param( "query" ) String query,
> @Param( "from" ) int from,
> @Param( "total" ) int total );
> When the query returns results, I get an exception caused by a
> parameter not being found:
> Caused by: org.neo4j.cypher.ParameterNotFoundException: Expected a
> parameter named from
> at org.neo4j.cypher.commands.Parameter$$anonfun$apply
> $5.apply(Expression.scala:187)
> at org.neo4j.cypher.commands.Parameter$$anonfun$apply
> $5.apply(Expression.scala:187)
> at scala.collection.MapLike$class.getOrElse(MapLike.scala:122)
> at scala.collection.immutable.Map$Map2.getOrElse(Map.scala:122)
> at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:187)
> at org.neo4j.cypher.commands.Parameter.apply(Expression.scala:186)
> at org.neo4j.cypher.internal.pipes.SlicePipe.asInt$1(SlicePipe.scala:
> 37)
> at
> org.neo4j.cypher.internal.pipes.SlicePipe.createResults(SlicePipe.scala:
> 44)
> at
> org.neo4j.cypher.internal.pipes.ColumnFilterPipe.createResults(ColumnFilter Pipe.scala:
> 33)
> at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
> $prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
> at org.neo4j.cypher.internal.ExecutionPlanImpl$$anonfun
> $prepareExecutionPlan$3.apply(ExecutionPlanImpl.scala:86)
> at
> org.neo4j.cypher.internal.ExecutionPlanImpl.execute(ExecutionPlanImpl.scala :
> 33)
> at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:59)
> at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55)
> at
> org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:
> 78)
> at
> org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExec uteQuery(CypherQueryEngine.java:
> 63)
> ... 98 more
> I have debugged it as far as I can and in the step createResults of
> the SlicePipe I can see "from" and "total" with the correct values as
> params.
> My version of neo4j is 1.6.M02.
> Do you have any idea about why is this error happening and how to
> solve it?
Same in here : I'm using Neo4jPHP client and got the same error on 1.8. To bypass this problem using it (in PHP), informations are available here : https://github.com/jadell/neo4jphp/issues/72