Skip to content

Commit 8d88cab

Browse files
committed
Store target separately in child class
1 parent f9da336 commit 8d88cab

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lucene/core/src/java/org/apache/lucene/search/KnnFloatVectorQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class KnnFloatVectorQuery extends AbstractKnnVectorQuery {
4747

4848
private static final TopDocs NO_RESULTS = TopDocsCollector.EMPTY_TOPDOCS;
4949

50-
final float[] target;
50+
private final float[] target;
5151

5252
/**
5353
* Find the <code>k</code> nearest documents to the target vector according to the vectors in the

lucene/core/src/java/org/apache/lucene/search/TwoPhaseKnnVectorQuery.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class TwoPhaseKnnVectorQuery extends KnnFloatVectorQuery {
3636

3737
private final int originalK;
3838
private final double oversample;
39+
private final float[] target;
3940

4041
/**
4142
* Find the <code>k</code> nearest documents to the target vector according to the vectors in the
@@ -55,6 +56,7 @@ public TwoPhaseKnnVectorQuery(
5556
if (oversample < 0) {
5657
throw new IllegalArgumentException("oversample must be non-negative, got " + oversample);
5758
}
59+
this.target = target;
5860
this.originalK = k;
5961
this.oversample = oversample;
6062
}

0 commit comments

Comments
 (0)