That's why I suggested UNION. So the two individual queries take 14s? Still way too long.
On Wed, May 21, 2014 at 3:40 PM, Tom Zeppenfeldt <[email protected]>wrote: > I have some problems starting the shell from my Mac Terminal (it's giving > me a out of mem error) , but form the webadmin powerconsole. Can't find any > documentation either on how to set shell to have me return profile. > > neo4j-sh (?)$ export termname="Eurovoc" > > *Your first Query* > neo4j-sh (?)$ match > (j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t:term)-[:BT]->(t2:term > {name:{termname}}) return t.name, count(distinct j) as count order by > count desc limit 10 > > > ; > ==> +-------------------------------------------------+ > ==> | t.name | count | > ==> +-------------------------------------------------+ > ==> | "gezondheidsbeleid" | 1823 | > ==> | "overtreding" | 1393 | > ==> | "Europese organisatie" | 1389 | > ==> | "EU-instantie" | 1323 | > ==> | "mondiale organisatie" | 1277 | > ==> | "gespecialiseerde instelling van de VN" | 1143 | > ==> | "handeling van de EU" | 1129 | > ==> | "internationaal publiekrecht" | 1091 | > ==> | "sociaal beleid" | 971 | > ==> | "rechtsvordering" | 915 | > ==> +-------------------------------------------------+ > ==> 10 rows > *==> 8775 ms* > > *Your second Query* > neo4j-sh (?)$ match (j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t2:term > {name:{termname}}) return t.name, count(distinct j) as count order by > count desc limit 10; > ==> SyntaxException: t not defined (line 1, column 79) > ==> "match (j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t2:term {name:{termname}}) > return t.name, count(distinct j) as count order by count desc limit 10" > ==> > ^ > neo4j-sh (?)$ match (j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t2:term > {name:{termname}}) return t2.name, count(distinct j) as count order by > count desc limit 10; > ==> +-------------------+ > ==> | t2.name | count | > ==> +-------------------+ > ==> | "Eurovoc" | 9576 | > ==> +-------------------+ > ==> 1 row > *==> 3668 ms* > > > But what I need is to include the docs on both the term I request and the > count on its children, like this. I notice that the combination takes > longer than the two separate queries combined. > > neo4j-sh (?)$ match > (j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t:term)-[:BT*0..1]->(t2:term > {name:{termname}}) return t.name, count(distinct j) as count order by > count desc limit 10; > ==> +-------------------------------------------------+ > ==> | t.name | count | > ==> +-------------------------------------------------+ > ==> | "Eurovoc" | 9576 | > ==> | "gezondheidsbeleid" | 1823 | > ==> | "overtreding" | 1393 | > ==> | "Europese organisatie" | 1389 | > ==> | "EU-instantie" | 1323 | > ==> | "mondiale organisatie" | 1277 | > ==> | "gespecialiseerde instelling van de VN" | 1143 | > ==> | "handeling van de EU" | 1129 | > ==> | "internationaal publiekrecht" | 1091 | > ==> | "sociaal beleid" | 971 | > ==> +-------------------------------------------------+ > ==> 10 rows > *==> 17802 ms* > > -- > 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. > -- 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.
