I talked to our engineers, and they said the old behavior was wrong and fixed in 2.1.7 and 2.2
You have to specify min-lenght of 0 if you want get nodes back that are directly the start / end-node. Michael > Am 20.03.2015 um 13:24 schrieb Ziv Unger <[email protected]>: > > Hi > > We currently have many rather lengthy, complex Cypher queries running on > 2.1.x. I wanted to see the potential performance improvements in 2.2's Cypher > query planner, so I imported our DB to 2.2 and ran the queries on it. > > However, I immediately noticed that I was only getting a subset of the > results I'd gotten on 2.1.x, and in some cases no results. After some > investigation, it turns out it has to do with different behaviour (and > syntax) of shortestPath in 2.2. > > The offending lines in the query are: > > match objectives-[:target_region]->regions, > oregions<-[:target_region]-oobjectives > match path=shortestPath(regions-[:has_child*..4]-oregions) > > Regions are a simple parent > child hierarchy, where a parent region is > linked to their child nodes (also regions) via a [:has_child] relationship. > objectives and oobjectives are identified and matched earlier in the query. > The basic premise is to find objectives belonging to two different companies > which target either the same regions, or regions that are connected by virtue > of being ancestors / descendants of each other. > > In 2.1.x, this returns 4 results for this particular set of criteria. Two are > direct region matches (Brazil and Australia match each other directly on both > sides) and two are descendants (Australia matches two objectives in New South > Whales) > > In 2.2, it returns only two - the descendants results (Australia <-> NSW) > > After some hair pulling, I wondered if perhaps the reason 2.2 wasn't finding > the direct matches was that *..4 didn't specify a minimum length. This turned > out to be the case, as replacing the relevant line with: > > match path=shortestPath(regions-[:has_child*0..4]-oregions) > > produces the same results as 2.1.x. > > I thought great, so this is how 2.2 does it, let me back-port it into the app > so the switchover will be easier when 2.2 is released. However, attempting to > replace this line in 2.1.x gives me this error: > > "shortestPath(...) does not support a minimal length" > > So my question is - is this intended? Did I miss some release notes with > breaking changes for 2.2? > > Many thanks > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
