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
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
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
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",
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
5 matches
Mail list logo