Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -19,11 +19,11 @@ public interface BulkScorableByteVectorValues extends BulkScorableVectorValues {
* Returns a {@link BulkVectorScorer} that can score against the provided {@code target} vector.
* It will score to the fastest speed possible, potentially sacrificing some fidelity.
*/
BulkVectorScorer scorer(byte[] target) throws IOException;
BulkVectorScorer bulkScorer(byte[] target) throws IOException;

/**
* Returns a {@link BulkVectorScorer} that can rescore against the provided {@code target} vector.
* It will score to the highest fidelity possible, potentially sacrificing some speed.
*/
BulkVectorScorer rescorer(byte[] target) throws IOException;
BulkVectorScorer bulkRescorer(byte[] target) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public interface BulkScorableFloatVectorValues extends BulkScorableVectorValues
* Returns a {@link BulkVectorScorer} that can score against the provided {@code target} vector.
* It will score to the fastest speed possible, potentially sacrificing some fidelity.
*/
BulkVectorScorer scorer(float[] target) throws IOException;
BulkVectorScorer bulkScorer(float[] target) throws IOException;

/**
* Returns a {@link BulkVectorScorer} that can rescore against the provided {@code target} vector.
* It will score to the highest fidelity possible, potentially sacrificing some speed.
*/
BulkVectorScorer rescorer(float[] target) throws IOException;
BulkVectorScorer bulkRescorer(float[] target) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public interface BulkScorableVectorValues {
interface BulkVectorScorer extends VectorScorer {

/**
* Returns a {@link Bulk} scorer that can score in bulk the provided {@code matchingDocs}.
* Returns a {@link BulkScorer} scorer that can score in bulk the provided {@code matchingDocs}.
*/
Bulk bulk(DocIdSetIterator matchingDocs) throws IOException;
BulkScorer bulkScore(DocIdSetIterator matchingDocs) throws IOException;

interface Bulk {
interface BulkScorer {
/**
* Scores up to {@code nextCount} docs in the provided {@code buffer}.
* Returns the maxScore of docs scored.
*/
float nextDocsAndScores(int nextCount, Bits liveDocs, DocAndFloatFeatureBuffer buffer) throws IOException;
void nextDocsAndScores(int nextCount, Bits liveDocs, DocAndFloatFeatureBuffer buffer) throws IOException;
Copy link
Member

Choose a reason for hiding this comment

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

The return value change might cause problems?

Copy link
Member Author

Choose a reason for hiding this comment

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

@thecoop not right now. The lucene version will return floats, but ours won't as the random vector scorer doesn't return max scores yet

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ private void rescoreBulk(
List<ScoreDoc> queue,
DocIdSetIterator filterIterator
) throws IOException {
BulkScorableVectorValues.BulkVectorScorer vectorReScorer = rescorableVectorValues.rescorer(floatTarget);
BulkScorableVectorValues.BulkVectorScorer vectorReScorer = rescorableVectorValues.bulkRescorer(floatTarget);
var iterator = vectorReScorer.iterator();
BulkScorableVectorValues.BulkVectorScorer.Bulk bulkScorer = vectorReScorer.bulk(filterIterator);
BulkScorableVectorValues.BulkVectorScorer.BulkScorer bulkScorer = vectorReScorer.bulkScore(filterIterator);
DocAndFloatFeatureBuffer buffer = new DocAndFloatFeatureBuffer();
while (iterator.docID() != DocIdSetIterator.NO_MORE_DOCS) {
// iterator already takes live docs into account
Expand Down