You can use what you wrote and then use lucene numeric range query to do
the trick:

   Index<Relationship> index = ...
   index.add( rel2, "ORDER", ValueContext.numeric(2) );
   index.add( rel3, "ORDER", ValueContext.numeric(3) );
   index.add( rel1, "ORDER", ValueContext.numeric(1) );
   ........
   // For all relationships
   index.query( new QueryContext( NumericRangeQuery.newIntRange(
"ORDER",null,null,true,true ) ).sortNumeric( "ORDER", false ) );
   // For a range
   index.query( new QueryContext( NumericRangeQuery.newIntRange(
"ORDER",2,10,true,true ) ).sortNumeric( "ORDER", false ) );

2011/10/31 Evgeny Gazdovsky <[email protected]>

> PS
> We don't need a traverse through relationships
> in stored order, only iterations for start or end node.
>
> --
> Evgeny
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [[email protected]]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to