Guys, with the custom sorting in Lucene and this thread coming up all the time, I took the time to document the execution of arbitrary Groovy and thus, Java calls through REST. In the example below, there are calls to Neo4j APIs, Gremlin stuff and custom sorting using Lucene classes, and return of a Neo4j search hit object.
You can do all this in a Neo4j Server plugin, but if you need to, this is an example on how to do it with only REST. http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-send-an-arbitrary-groovy-script---lucene-sorting Hope that helps for future reference! Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Thu, Aug 25, 2011 at 1:00 AM, Matt Luongo <m...@scholr.ly> wrote: > +1, we could really use that. Client-side sorting sucks. > > -- > Matt Luongo > Co-Founder, Scholr.ly > > > > On Wed, Aug 24, 2011 at 4:43 PM, Aseem Kishore <aseem.kish...@gmail.com > >wrote: > > > 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 > > User@lists.neo4j.org > > https://lists.neo4j.org/mailman/listinfo/user > > > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user