Parameter Not

93 views
Skip to first unread message

mrwizard

unread,
May 30, 2012, 5:08:33 AM5/30/12
to Neo4j
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(ColumnFilterPipe.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.parseAndExecuteQuery(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?

Many thanks in advanced.

Andres Taylor

unread,
May 30, 2012, 7:45:28 AM5/30/12
to ne...@googlegroups.com
On Wed, May 30, 2012 at 11:08 AM, mrwizard <jav...@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. 

HTH,

Andrés

Santiago Baldrich

unread,
Jul 30, 2012, 1:26:19 PM7/30/12
to ne...@googlegroups.com

Hello Andrés, I'm using Neo4j 1.7.2 and this problem still arises. Do you happen to know a way to avoid it?

Thank you.

- Santiago


Peter Neubauer

unread,
Jul 31, 2012, 3:50:16 AM7/31/12
to ne...@googlegroups.com
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?

Cheers,

/peter neubauer

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

Wanna learn something new? Come to @graphconnect.

Michael Hunger

unread,
Jul 31, 2012, 4:21:27 AM7/31/12
to ne...@googlegroups.com
What about using a PageRequest parameter which contains the pageSize and offset information and will be added to your query?

Michael
Reply all
Reply to author
Forward
0 new messages