hmmm...
tried several things, but theses all result in the exception below
(the important part is the WHERE clause, if we leave out the AND
condition it works like charm so the query is basically 100% ok).
Maybe I should have mentioned we are passing in the IDs we want to
filter as a query param (List<Long> offerIds), just to make sure you
get the situation right I put down our Repo-Service right here:
@Query("start similarSpat=node:GEO_INDEX({withinDistanceParam}),
offer=node({offerId}) " +
"MATCH (offer) -[r:"+RelTypes.CATEGORY_LINK+"]-> (category) " +
"<-[r2:"+RelTypes.CATEGORY_LINK+"]- (similar) " +
"<-[r3:GEOFIES]-loc<-[r4:MANUAL_SPATIAL_CONNECT]-similarSpat " +
"WHERE (similar.__type__ = 'Offer' " +
"AND ID(similar) NOT IN [{offerIds}]) " +
"return distinct similar, sum(r2.emphasis) order by
sum(r2.emphasis) desc")
public Page<OfferRecommendation>
findRelatedOffersForOfferWithinRadiusExcluding(
@Param("offerId") long offerId,
@Param("withinDistanceParam") String withinDistanceParam,
@Param("offerIds") List<Long> offerIds,
Pageable page);
Any clue what should be changed?
Thanx, Florian...
Error executing statement start
similarSpat=node:GEO_INDEX({withinDistanceParam}),
offer=node({offerId}) MATCH (offer) -[r:CATEGORY_LINK]-> (category) <-
[r2:CATEGORY_LINK]- (similar) <-[r3:GEOFIES]-loc<-
[r4:MANUAL_SPATIAL_CONNECT]-similarSpat WHERE (similar.__type__ =
'Offer' AND ID(similar) NOT IN [{offerIds}]) return distinct similar,
sum(r2.emphasis) order by sum(r2.emphasis) desc skip 0 limit 6; nested
exception is
org.springframework.dao.InvalidDataAccessResourceUsageException: Error
executing statement start
similarSpat=node:GEO_INDEX({withinDistanceParam}),
offer=node({offerId}) MATCH (offer) -[r:CATEGORY_LINK]-> (category) <-
[r2:CATEGORY_LINK]- (similar) <-[r3:GEOFIES]-loc<-
[r4:MANUAL_SPATIAL_CONNECT]-similarSpat WHERE (similar.__type__ =
'Offer' AND ID(similar) NOT IN [{offerIds}]) return distinct similar,
sum(r2.emphasis) order by sum(r2.emphasis) desc skip 0 limit 6; nested
exception is `-' expected but `N' found
Unfortunately, you have run into a syntax error that we don't have a
nice message for.
By sending the query that produced this error to
cyp...@neo4j.org,
you'll save the
puppies and get better error messages in our next release.
Thank you, the Neo4j Team.] with root cause
`-' expected but `N' found
Unfortunately, you have run into a syntax error that we don't have a
nice message for.
By sending the query that produced this error to
cyp...@neo4j.org,
you'll save the
puppies and get better error messages in our next release.
Thank you, the Neo4j Team.
at
org.neo4j.cypher.internal.parser.v1_7.CypherParserImpl.parse(CypherParserImpl.scala:
68)
at org.neo4j.cypher.CypherParser.parse(CypherParser.scala:44)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare
$1.apply(ExecutionEngine.scala:61)
at org.neo4j.cypher.ExecutionEngine$$anonfun$prepare
$1.apply(ExecutionEngine.scala:61)
at org.neo4j.cypher.internal.LRUCache.getOrElseUpdate(LRUCache.scala:
31)
at org.neo4j.cypher.ExecutionEngine.prepare(ExecutionEngine.scala:61)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:55)
at org.neo4j.cypher.ExecutionEngine.execute(ExecutionEngine.scala:58)
at
org.neo4j.cypher.javacompat.ExecutionEngine.execute(ExecutionEngine.java:
86)
at
org.springframework.data.neo4j.support.query.CypherQueryEngine.parseAndExecuteQuery(CypherQueryEngine.java:
65)
at
org.springframework.data.neo4j.support.query.CypherQueryEngine.query(CypherQueryEngine.java:
53)
at
org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.dispatchQuery(GraphRepositoryQuery.java:
87)
at
org.springframework.data.neo4j.repository.query.GraphRepositoryQuery.execute(GraphRepositoryQuery.java:
70)
at
org.springframework.data.repository.core.support.RepositoryFactorySupport
$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:
313)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
171)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:
110)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
171)
at
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:
155)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
171)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:
204)
at $Proxy83.findRelatedOffersForOfferWithinRadiusExcluding(Unknown
Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:
307)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:
198)
at $Proxy84.findRelatedOffersForOfferWithinRadiusExcluding(Unknown
Source)
at
com.helios.service.plain.OfferService.findOffersSimilarExceptVisited(OfferService.java:
665)
at
com.helios.web.controller.OfferController.detail(OfferController.java:
364)
at com.helios.web.controller.OfferController$$FastClassByCGLIB$
$a1c74a23.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy
$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)
at com.helios.web.controller.OfferController$$EnhancerByCGLIB$
$fbb2a9df.detail(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:
212)
at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:
126)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:
96)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:
617)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:
578)
at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:
80)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:
900)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:
827)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:
882)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:
778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210)
at
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:
155)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210)
at
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:
197)
at
net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:
171)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:
116)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:
83)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:
113)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:
101)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:
113)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:
54)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:
45)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:
182)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:
105)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:
87)
at org.springframework.security.web.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:
173)
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:
346)
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:
259)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210)
at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:
88)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:
76)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:
472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
928)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:
987)
at org.apache.coyote.AbstractProtocol
$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint
$SocketProcessor.run(JIoEndpoint.java:300)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
On 20 Mai, 13:11, Peter Neubauer <
neubauer.pe...@gmail.com> wrote:
> I think you could use
>
> Id(x) not in [1, 5,9 ]
>
> Send from mobile.