[Neo4j] Behaviour of LuceneIndex vs. BatchInserterIndex for multiple adds

Mattias Persson mattias at neotechnology.com
Mon Sep 19 08:14:07 CEST 2011

There are currently no such plans, but it could be of good convenience to
have such an add() method on Index interface also. Performance benefits
wouldn't be that significant (other than for those places where you index
one value per transaction).

Den onsdagen den 14:e september 2011 skrev Benjamin Gehrels<
neo4j-mailinglist at gehrels.info>:
> Hi all,
> as far as i know, the Batch Inserter Index has a slightly different
> behaviour than the default LuceneIndex:
> 1. It supports the addition of multiple Key/Value pairs at once and
> 2. Multiple calls to add() will result in multiple Index entries
> The default Lucene Index implementation does not support this. What
> seems to be undesired behaviour mainly introduced to gain a little bit
> of performance has a huge benefit:
> It allows indexing of M:N-Relations at the node level. Imagine a graph
> with 2 Persons and 4 kinds of Vehicles: Person 1, Person 2, yellow
> buses, yellow bicyles, red buses and red bicycles. Let the graph be the
> following:
> Person 1 -OWNS-> Yellow Bus
> Person 2 -OWNS-> Red Bicycle
> Person 2 -OWNS-> Red Bus
> Person 2 -OWNS-> Yellow Bicyle
> Using the batch inserter one can now call
> personNodeIndex.add(1, color->yellow, vehicle->bus)
> personNodeIndex.add(1, color->red, vehicle->bicyle)
> personNodeIndex.add(1, color->red, vehicle->bus)
> personNodeIndex.add(1, color->yellow, vehicle->bicycle)
> and personNodeIndex.query("color:yellow vehicle:bus") will return *only*
> person 1.
> Since this behaviour is not present in the LuceneIndex, i fear that you
> will probably try to "fix" the behaviour to be the same as with
> LuceneIndex. Are there plans to do so?
>  From my perspective, it would be a cooler thing to have the
> BatchInserterIndexes behaviour within the LuceneIndex to. Do you plan
> something like this?
> Best regards,
> Benjamin
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology

More information about the User mailing list