I've just spent a bunch of time reading into how one can control the
ordering of a traverse beyond simple "breadth first" or "depth first". More
precisely, even when breadth first, how one can control *which* neighbors
are traversed first.

(It matters less in which order they're traversed vs. which order they're
returned if you're returning all results, since you can just sort on the
client. But it matters a lot if you want to use the paged traverser, since
you're then only returning the first results.)

I've learned that this is doable from Java by writing your own
BranchSelector implementation:

http://components.neo4j.org/neo4j/1.4.1/apidocs/

I've found the built-in implementations, e.g. the pre-order breadth-first
and depth-first:

https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/PreorderBreadthFirstSelector.java

https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/PreorderDepthFirstSelector.java

To achieve a custom "best first", Igor Dovgiy for example shared that he
modeled his implementation of the breadth-first selector, except just using
a PriorityQueue instead of a regular Queue.

My question is: is there any way to specify this sort of thing over the REST
API instead of having to write a plugin? If not, does that sound like a
reasonable feature request?

I really just want something simple: nodes ordered by some "timestamp"
property. It's killing us that we can't do this today. We might just have to
look into writing this as a plugin...

Thanks!

Aseem
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to