Hi,

Berkeley Db index looks better for that. It was updated to serve our needs,
but better performance required.

Mattias, do you know low storage structure? Maybe, it'll possible to use
some structural conditions to restore relationships order. At current
design we have two writes for one relationship, that always 2 times slow
than one =)

On Mon, Oct 31, 2011 at 6:45 PM, Mattias Persson
<[email protected]>wrote:

> 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 ) );
>

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

Reply via email to