I have the following case study. I want to get the neighbors of the certain
node. My function is this one:
public Set<Integer> getNeighborsIds(int nodeId) {
Set<Integer> neighbours = new HashSet<Integer>();
try (Transaction tx = neo4jGraph.beginTx()) {
Node n = nodeIndex.get("nodeId", nodeId).getSingle();
for(Relationship relationship : n.getRelationships(Direction.OUTGOING)) {
Node neighbour = relationship.getEndNode();
String neighbourId = (String)neighbour.getProperty("nodeId");
neighbours.add(Integer.valueOf(neighbourId));
}
tx.success();
tx.close();
}
return neighbours;
}
I know that this node has 255 neighbors but this function return only 100
nodes. When I put this line
System.out.println(IteratorUtil.count(n.getRelationships(Direction.OUTGOING)));
4 and 5 line the function returns 255 neighbors. The most strange is that
the above function prints out the value 100. Is this a bug or can anyone
explain this to me?
Thanks,
Sotiris
--
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.