neo4j/community — Issue #87: Cypher queries with where clauses using relationship identifiers and return distinct and order by is not working
Author: gustavoboby
Created: 2011-11-09 14:45:39+00:00
State: open

This query does not work:
start x = node:my_auto_index(Type='Perfil') match (n)-[rp:Postou]-(x)-[rc:Adicionou]->() where rc.StatusConvite = 'Aceito' AND x.Email = 'Tester1@grupoec.com.br' return distinct n ORDER BY n.Data DESC SKIP 0 LIMIT 20

if i use only order by or only distinct, works fine!

I'm using rest API and the result error was:

500 Internal Server Error
{
"message" : "key not found: n.Data",
"exception" : "java.util.NoSuchElementException: key not found: n.Data",
"stacktrace" : [ "scala.collection.MapLike$class.default(MapLike.scala:224)", "scala.collection.immutable.Map$Map1.default(Map.scala:106)", "scala.collection.MapLike$class.apply(MapLike.scala:135)", "scala.collection.immutable.Map$Map1.apply(Map.scala:106)", "org.neo4j.cypher.pipes.SortPipe.compareBy(SortPipe.scala:39)", "org.neo4j.cypher.pipes.SortPipe$$anonfun$1.apply(SortPipe.scala:30)", "org.neo4j.cypher.pipes.SortPipe$$anonfun$1.apply(SortPipe.scala:30)", "scala.math.Ordering$$anon$7.compare(Ordering.scala:149)", "java.util.TimSort.countRunAndMakeAscending(Unknown Source)", "java.util.TimSort.sort(Unknown Source)", "java.util.TimSort.sort(Unknown Source)", "java.util.Arrays.sort(Unknown Source)", "scala.collection.SeqLike$class.sorted(SeqLike.scala:634)", "scala.collection.immutable.List.sorted(List.scala:45)", "scala.collection.SeqLike$class.sortWith(SeqLike.scala:591)", "scala.collection.immutable.List.sortWith(List.scala:45)", "org.neo4j.cypher.pipes.SortPipe.foreach(SortPipe.scala:30)", "scala.collection.TraversableLike$$anonfun$scala$collection$TraversableLike$$sliceInternal$1.apply$mcV$sp(TraversableLike.scala:453)", "scala.util.control.Breaks.breakable(Breaks.scala:35)", "scala.collection.TraversableLike$class.scala$collection$TraversableLike$$sliceInternal(TraversableLike.scala:452)", "scala.collection.TraversableLike$class.sliceWithKnownBound(TraversableLike.scala:476)", "org.neo4j.cypher.pipes.Pipe.sliceWithKnownBound(Pipe.scala:31)", "scala.collection.TraversableLike$class.slice(TraversableLike.scala:447)", "org.neo4j.cypher.pipes.Pipe.slice(Pipe.scala:31)", "org.neo4j.cypher.pipes.SlicePipe.foreach(SlicePipe.scala:32)", "org.neo4j.cypher.pipes.ColumnFilterPipe.foreach(ColumnFilterPipe.scala:34)", "scala.collection.TraversableLike$class.map(TraversableLike.scala:194)", "org.neo4j.cypher.pipes.Pipe.map(Pipe.scala:31)", "org.neo4j.cypher.ExecutionResult$class.javaIterator(ExecutionResult.scala:43)", "org.neo4j.cypher.ExecutionEngine$$anon$1.javaIterator(ExecutionEngine.scala:119)", "org.neo4j.cypher.javacompat.ExecutionResult.iterator(ExecutionResult.java:51)", "org.neo4j.server.rest.repr.CypherResultRepresentation.data(CypherResultRepresentation.java:54)", "sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)", "java.lang.reflect.Method.invoke(Unknown Source)", "org.neo4j.server.rest.repr.ObjectRepresentation$1.get(ObjectRepresentation.java:92)", "org.neo4j.server.rest.repr.ObjectRepresentation$PropertyGetter.putTo(ObjectRepresentation.java:131)", "org.neo4j.server.rest.repr.ObjectRepresentation.serialize(ObjectRepresentation.java:143)", "org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:42)", "org.neo4j.server.rest.repr.OutputFormat.format(OutputFormat.java:123)", "org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:100)", "org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:48)", "org.neo4j.server.rest.web.ExtensionService.invokeGraphDatabaseExtension(ExtensionService.java:122)", "sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)", "java.lang.reflect.Method.invoke(Unknown Source)", "com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)", "com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)", "com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)", "com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)", "com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)", "com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)", "com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)", "com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)", "com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)", "com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:699)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:820)", "org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)", "org.neo4j.server.statistic.StatisticFilter.doFilter(StatisticFilter.java:62)", "org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)", "org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)", "org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)", "org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)", "org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)", "org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)", "org.mortbay.jetty.Server.handle(Server.java:326)", "org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)", "org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)", "org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)", "org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)", "org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)", "org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)", "org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)" ]
}