Re: [Neo4j] limiting results

2011-03-07 Thread Marko Rodriguez
Hi, > In order to get a random node you'd need to know the full result set. > Alternatively you can make your traverser go in random directions and that > way get a random result set. Not necessarily. If, by chance, you know how many vertices you will be returning, you can using a sampling appro

Re: [Neo4j] limiting results

2011-03-07 Thread David Montag
Charlie, As Michael duly pointed out, the traverser is a lazy iterator, so you can simply just pull the first N results from it. In order to get a random node you'd need to know the full result set. Alternatively you can make your traverser go in random directions and that way get a random result

Re: [Neo4j] limiting results

2011-03-07 Thread Michael Hunger
As the traverser returns its results lazily you can just stop after N nodes (for embedded mode). If you talking REST-server there is currently no such limitation but REST improvements are worked on. You can easily write your own server plugin or addon that does this, though. Cheers Michael A

Re: [Neo4j] limiting results

2011-03-07 Thread Max De Marzi Jr.
I believe you can tie in to returnedNodesCount() http://components.neo4j.org/neo4j-examples/1.3.M02/apidocs/index.html?org/neo4j/graphdb/StopEvaluator.html @neo.traverse(school,"nodes", {"order" => "breadth first", "uniqueness" => "node global",

[Neo4j] limiting results

2011-03-07 Thread charlie
Is there a way to limit the number of results that are returned from a traverse? I have a traversal that returns thousands of nodes. Ideally I would like to get either a random set of those nodes, failing that I would be happy with the the first N nodes. Charlie White Avvo, Inc. 1218 Third