Search in sources :

Example 1 with LongCostume

use of org.neo4j.index.impl.lucene.legacy.EntityId.LongCostume in project neo4j by neo4j.

the class LuceneLegacyIndex method letThroughAdditions.

private void letThroughAdditions(IndexSearcher additionsSearcher, Query query, Collection<EntityId> removed) throws IOException {
    // This could be improved further by doing a term-dict lookup for every term in removed
    // and retaining only those that did not match.
    // This is getting quite low-level though
    DocValuesCollector collector = new DocValuesCollector(false);
    additionsSearcher.search(query, collector);
    PrimitiveLongIterator valuesIterator = collector.getValuesIterator(KEY_DOC_ID);
    LongCostume id = new LongCostume();
    while (valuesIterator.hasNext()) {
        long value = valuesIterator.next();
        removed.remove(id.setId(value));
    }
}
Also used : PrimitiveLongIterator(org.neo4j.collection.primitive.PrimitiveLongIterator) LongCostume(org.neo4j.index.impl.lucene.legacy.EntityId.LongCostume) DocValuesCollector(org.neo4j.kernel.api.impl.index.collector.DocValuesCollector)

Aggregations

PrimitiveLongIterator (org.neo4j.collection.primitive.PrimitiveLongIterator)1 LongCostume (org.neo4j.index.impl.lucene.legacy.EntityId.LongCostume)1 DocValuesCollector (org.neo4j.kernel.api.impl.index.collector.DocValuesCollector)1