Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ private static void score(
public PostingVisitor getPostingVisitor(FieldInfo fieldInfo, IndexInput indexInput, float[] target, Bits acceptDocs)
throws IOException {
FieldEntry entry = fields.get(fieldInfo.number);
final int maxPostingListSize = indexInput.readVInt();
return new MemorySegmentPostingsVisitor(target, indexInput, entry, fieldInfo, maxPostingListSize, acceptDocs);
// max postings list size, no longer utilized
indexInput.readVInt();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just not write the max posting list size?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I am making this change in the next format version.

return new MemorySegmentPostingsVisitor(target, indexInput, entry, fieldInfo, acceptDocs);
}

@Override
Expand Down Expand Up @@ -393,14 +394,8 @@ private static class MemorySegmentPostingsVisitor implements PostingVisitor {
final float[] correctiveValues = new float[3];
final long quantizedVectorByteSize;

MemorySegmentPostingsVisitor(
float[] target,
IndexInput indexInput,
FieldEntry entry,
FieldInfo fieldInfo,
int maxPostingListSize,
Bits acceptDocs
) throws IOException {
MemorySegmentPostingsVisitor(float[] target, IndexInput indexInput, FieldEntry entry, FieldInfo fieldInfo, Bits acceptDocs)
throws IOException {
this.target = target;
this.indexInput = indexInput;
this.entry = entry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ public int size() {
public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, float[] globalCentroid)
throws IOException {

long nanoTime = System.nanoTime();

// TODO: consider hinting / bootstrapping hierarchical kmeans with the prior segments centroids
CentroidAssignments centroidAssignments = buildCentroidAssignments(floatVectorValues, vectorPerCluster);
float[][] centroids = centroidAssignments.centroids();
Expand All @@ -549,7 +547,6 @@ public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorVa
}

if (logger.isDebugEnabled()) {
logger.debug("calculate centroids and assign vectors time ms: {}", (System.nanoTime() - nanoTime) / 1000000.0);
logger.debug("final centroid count: {}", centroids.length);
}
return centroidAssignments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,6 @@ public int size() {
public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorValues floatVectorValues, float[] globalCentroid)
throws IOException {

long nanoTime = System.nanoTime();

// TODO: consider hinting / bootstrapping hierarchical kmeans with the prior segments centroids
CentroidAssignments centroidAssignments = buildCentroidAssignments(floatVectorValues, vectorPerCluster);
float[][] centroids = centroidAssignments.centroids();
Expand All @@ -537,7 +535,6 @@ public CentroidAssignments calculateCentroids(FieldInfo fieldInfo, FloatVectorVa
}

if (logger.isDebugEnabled()) {
logger.debug("calculate centroids and assign vectors time ms: {}", (System.nanoTime() - nanoTime) / 1000000.0);
logger.debug("final centroid count: {}", centroids.length);
}
return centroidAssignments;
Expand Down