@Override public void intersect(IntersectVisitor visitor) throws IOException { in.intersect(new IntersectVisitor() { @Override public void visit(int docID) throws IOException { visitor.visit(docMap.oldToNew(docID)); } @Override public void visit(int docID, byte[] packedValue) throws IOException { visitor.visit(docMap.oldToNew(docID), packedValue); } @Override public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { return visitor.compare(minPackedValue, maxPackedValue); } }); }
/** Sliced reference to points in an OfflineSorter.ByteSequencesWriter file. */ private static final class PathSlice { final PointWriter writer; final long start; final long count; public PathSlice(PointWriter writer, long start, long count) { this.writer = writer; this.start = start; this.count = count; } @Override public String toString() { return "PathSlice(start=" + start + " count=" + count + " writer=" + writer + ")"; } }
long countPerLeaf = pointCount = values.size(); long innerNodeCount = 1; Arrays.fill(maxPackedValue, (byte) 0); for (int i = 0; i < Math.toIntExact(pointCount); ++i) { values.getValue(i, scratchBytesRef1); for(int dim=0;dim<numIndexDims;dim++) { int offset = dim*bytesPerDim; docsSeen.set(values.getDocID(i));
private long writeField1Dim(IndexOutput out, String fieldName, MutablePointValues reader) throws IOException { MutablePointsReaderUtils.sort(maxDoc, packedIndexBytesLength, reader, 0, Math.toIntExact(reader.size())); final OneDimensionBKDWriter oneDimWriter = new OneDimensionBKDWriter(out); reader.intersect(new IntersectVisitor() { @Override public void visit(int docID, byte[] packedValue) throws IOException { oneDimWriter.add(packedValue, docID); } @Override public void visit(int docID) throws IOException { throw new IllegalStateException(); } @Override public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { return Relation.CELL_CROSSES_QUERY; } }); return oneDimWriter.finish(); }
@Override public BytesRef apply(int i) { reader.getValue(from + i, scratchBytesRef1); return scratchBytesRef1; } };
@Override public long size() { return in.size(); }
@Override public int getDocID(int i) { return docMap.oldToNew(in.getDocID(i)); }
@Override public byte getByteAt(int i, int k) { return in.getByteAt(i, k); }
@Override public long estimatePointCount(IntersectVisitor visitor) { return in.estimatePointCount(visitor); }
@Override public byte[] getMinPackedValue() throws IOException { return in.getMinPackedValue(); }
@Override public int getBytesPerDimension() throws IOException { return in.getBytesPerDimension(); }
@Override public byte[] getMaxPackedValue() throws IOException { return in.getMaxPackedValue(); }
@Override public int getDocCount() { return in.getDocCount(); }
/** Sliced reference to points in an OfflineSorter.ByteSequencesWriter file. */ private static final class PathSlice { final PointWriter writer; final long start; final long count; public PathSlice(PointWriter writer, long start, long count) { this.writer = writer; this.start = start; this.count = count; } @Override public String toString() { return "PathSlice(start=" + start + " count=" + count + " writer=" + writer + ")"; } }
long countPerLeaf = pointCount = values.size(); long innerNodeCount = 1; Arrays.fill(maxPackedValue, (byte) 0); for (int i = 0; i < Math.toIntExact(pointCount); ++i) { values.getValue(i, scratchBytesRef1); for(int dim=0;dim<numIndexDims;dim++) { int offset = dim*bytesPerDim; docsSeen.set(values.getDocID(i));
private long writeField1Dim(IndexOutput out, String fieldName, MutablePointValues reader) throws IOException { MutablePointsReaderUtils.sort(maxDoc, packedIndexBytesLength, reader, 0, Math.toIntExact(reader.size())); final OneDimensionBKDWriter oneDimWriter = new OneDimensionBKDWriter(out); reader.intersect(new IntersectVisitor() { @Override public void visit(int docID, byte[] packedValue) throws IOException { oneDimWriter.add(packedValue, docID); } @Override public void visit(int docID) throws IOException { throw new IllegalStateException(); } @Override public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { return Relation.CELL_CROSSES_QUERY; } }); return oneDimWriter.finish(); }
@Override public void getValue(int i, BytesRef packedValue) { in.getValue(i, packedValue); }
@Override public long size() { return in.size(); }