Skip to content

Commit 8883a9d

Browse files
committed
Remove BulkVectorScorer implementations
1 parent db04926 commit 8883a9d

File tree

4 files changed

+16
-35
lines changed

4 files changed

+16
-35
lines changed

server/src/main/java/org/elasticsearch/index/codec/vectors/BulkScorableByteVectorValues.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@
99

1010
package org.elasticsearch.index.codec.vectors;
1111

12+
import org.apache.lucene.search.VectorScorer;
13+
1214
import java.io.IOException;
1315

1416
/**
1517
* Extension to {@link BulkScorableVectorValues} for byte[] vectors
1618
*/
1719
public interface BulkScorableByteVectorValues extends BulkScorableVectorValues {
1820
/**
19-
* Returns a {@link BulkVectorScorer} that can score against the provided {@code target} vector.
21+
* Returns a {@link VectorScorer} that can score against the provided {@code target} vector.
2022
* It will score to the fastest speed possible, potentially sacrificing some fidelity.
2123
*/
22-
BulkVectorScorer scorer(byte[] target) throws IOException;
24+
VectorScorer scorer(byte[] target) throws IOException;
2325

2426
/**
25-
* Returns a {@link BulkVectorScorer} that can rescore against the provided {@code target} vector.
27+
* Returns a {@link VectorScorer} that can rescore against the provided {@code target} vector.
2628
* It will score to the highest fidelity possible, potentially sacrificing some speed.
2729
*/
28-
BulkVectorScorer rescorer(byte[] target) throws IOException;
30+
VectorScorer rescorer(byte[] target) throws IOException;
2931
}

server/src/main/java/org/elasticsearch/index/codec/vectors/BulkScorableFloatVectorValues.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@
99

1010
package org.elasticsearch.index.codec.vectors;
1111

12+
import org.apache.lucene.search.VectorScorer;
13+
1214
import java.io.IOException;
1315

1416
/**
1517
* Extension to {@link BulkScorableVectorValues} for byte[] vectors
1618
*/
1719
public interface BulkScorableFloatVectorValues extends BulkScorableVectorValues {
1820
/**
19-
* Returns a {@link BulkVectorScorer} that can score against the provided {@code target} vector.
21+
* Returns a {@link VectorScorer} that can score against the provided {@code target} vector.
2022
* It will score to the fastest speed possible, potentially sacrificing some fidelity.
2123
*/
22-
BulkVectorScorer scorer(float[] target) throws IOException;
24+
VectorScorer scorer(float[] target) throws IOException;
2325

2426
/**
25-
* Returns a {@link BulkVectorScorer} that can rescore against the provided {@code target} vector.
27+
* Returns a {@link VectorScorer} that can rescore against the provided {@code target} vector.
2628
* It will score to the highest fidelity possible, potentially sacrificing some speed.
2729
*/
28-
BulkVectorScorer rescorer(float[] target) throws IOException;
30+
VectorScorer rescorer(float[] target) throws IOException;
2931
}

server/src/main/java/org/elasticsearch/index/codec/vectors/BulkScorableVectorValues.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,7 @@
99

1010
package org.elasticsearch.index.codec.vectors;
1111

12-
import org.apache.lucene.search.DocAndFloatFeatureBuffer;
13-
import org.apache.lucene.search.DocIdSetIterator;
14-
import org.apache.lucene.search.VectorScorer;
15-
import org.apache.lucene.util.Bits;
16-
17-
import java.io.IOException;
18-
1912
/**
2013
* Extension to {@link org.apache.lucene.search.VectorScorer} that can score in bulk
2114
*/
22-
public interface BulkScorableVectorValues {
23-
interface BulkVectorScorer extends VectorScorer {
24-
25-
/**
26-
* Returns a {@link Bulk} scorer that can score in bulk the provided {@code matchingDocs}.
27-
*/
28-
Bulk bulk(DocIdSetIterator matchingDocs) throws IOException;
29-
30-
interface Bulk {
31-
/**
32-
* Scores up to {@code nextCount} docs in the provided {@code buffer}.
33-
* Returns the maxScore of docs scored.
34-
*/
35-
float nextDocsAndScores(int nextCount, Bits liveDocs, DocAndFloatFeatureBuffer buffer) throws IOException;
36-
}
37-
}
38-
}
15+
public interface BulkScorableVectorValues {}

server/src/main/java/org/elasticsearch/search/vectors/RescoreKnnVectorQuery.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.apache.lucene.search.ScoreDoc;
2828
import org.apache.lucene.search.ScoreMode;
2929
import org.apache.lucene.search.TopDocs;
30+
import org.apache.lucene.search.VectorScorer;
3031
import org.elasticsearch.index.codec.vectors.BulkScorableFloatVectorValues;
31-
import org.elasticsearch.index.codec.vectors.BulkScorableVectorValues;
3232
import org.elasticsearch.search.profile.query.QueryProfiler;
3333

3434
import java.io.IOException;
@@ -317,9 +317,9 @@ private void rescoreBulk(
317317
List<ScoreDoc> queue,
318318
DocIdSetIterator filterIterator
319319
) throws IOException {
320-
BulkScorableVectorValues.BulkVectorScorer vectorReScorer = rescorableVectorValues.rescorer(floatTarget);
320+
VectorScorer vectorReScorer = rescorableVectorValues.rescorer(floatTarget);
321321
var iterator = vectorReScorer.iterator();
322-
BulkScorableVectorValues.BulkVectorScorer.Bulk bulkScorer = vectorReScorer.bulk(filterIterator);
322+
VectorScorer.Bulk bulkScorer = vectorReScorer.bulk(filterIterator);
323323
DocAndFloatFeatureBuffer buffer = new DocAndFloatFeatureBuffer();
324324
while (iterator.docID() != DocIdSetIterator.NO_MORE_DOCS) {
325325
// iterator already takes live docs into account

0 commit comments

Comments
 (0)