Skip to content

Commit ab484b5

Browse files
committed
Renaming typo
1 parent 0f956b4 commit ab484b5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ protected Query doToQuery(SearchExecutionContext context) throws IOException {
522522

523523
DenseVectorFieldType vectorFieldType = (DenseVectorFieldType) fieldType;
524524
String parentPath = context.nestedLookup().getNestedParent(fieldName);
525-
Float oversample = rescoreVectorBuilder() == null ? null : rescoreVectorBuilder.overesample();
525+
Float oversample = rescoreVectorBuilder() == null ? null : rescoreVectorBuilder.oversample();
526526

527527
BitSetProducer parentBitSet = null;
528528
if (parentPath != null) {

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,29 @@ public class RescoreVectorBuilder implements Writeable, ToXContentObject {
3535
}
3636

3737
// Oversample is required as of now as it is the only field in the rescore vector
38-
private final float numCandidatesFactor;
38+
private final float oversample;
3939

4040
public RescoreVectorBuilder(float numCandidatesFactor) {
4141
Objects.requireNonNull(numCandidatesFactor, "[" + OVERSAMPLE_FIELD.getPreferredName() + "] must be set");
4242
if (numCandidatesFactor < MIN_OVERSAMPLE) {
4343
throw new IllegalArgumentException("[" + OVERSAMPLE_FIELD.getPreferredName() + "] must be >= " + MIN_OVERSAMPLE);
4444
}
45-
this.numCandidatesFactor = numCandidatesFactor;
45+
this.oversample = numCandidatesFactor;
4646
}
4747

4848
public RescoreVectorBuilder(StreamInput in) throws IOException {
49-
this.numCandidatesFactor = in.readFloat();
49+
this.oversample = in.readFloat();
5050
}
5151

5252
@Override
5353
public void writeTo(StreamOutput out) throws IOException {
54-
out.writeFloat(numCandidatesFactor);
54+
out.writeFloat(oversample);
5555
}
5656

5757
@Override
5858
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
5959
builder.startObject();
60-
builder.field(OVERSAMPLE_FIELD.getPreferredName(), numCandidatesFactor);
60+
builder.field(OVERSAMPLE_FIELD.getPreferredName(), oversample);
6161
builder.endObject();
6262
return builder;
6363
}
@@ -71,15 +71,15 @@ public boolean equals(Object o) {
7171
if (this == o) return true;
7272
if (o == null || getClass() != o.getClass()) return false;
7373
RescoreVectorBuilder that = (RescoreVectorBuilder) o;
74-
return Objects.equals(numCandidatesFactor, that.numCandidatesFactor);
74+
return Objects.equals(oversample, that.oversample);
7575
}
7676

7777
@Override
7878
public int hashCode() {
79-
return Objects.hashCode(numCandidatesFactor);
79+
return Objects.hashCode(oversample);
8080
}
8181

82-
public float overesample() {
83-
return numCandidatesFactor;
82+
public float oversample() {
83+
return oversample;
8484
}
8585
}

0 commit comments

Comments
 (0)