Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Trent <[email protected]>
  • Loading branch information
carlosdelest and benwtrent authored Dec 11, 2024
1 parent 94963fc commit a256de9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
VectorSimilarityFloatValueSource that = (VectorSimilarityFloatValueSource) o;
return Objects.equals(field, that.field)
&& Objects.deepEquals(target, that.target)
&& Arrays.equals(target, that.target)
&& vectorSimilarityFunction == that.vectorSimilarityFunction;
}

@Override
public String toString() {
return "VectorSimilarityFloatValueSource(" + field + ", " + Arrays.toString(target) + ", " + vectorSimilarityFunction + ")";
return "VectorSimilarityFloatValueSource(" + field + ", [" + target[0] + ",...], " + vectorSimilarityFunction + ")";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
RescoreKnnVectorQuery that = (RescoreKnnVectorQuery) o;
return Objects.equals(fieldName, that.fieldName)
&& Objects.deepEquals(floatTarget, that.floatTarget)
&& Arrays.equals(floatTarget, that.floatTarget)
&& vectorSimilarityFunction == that.vectorSimilarityFunction
&& Objects.equals(k, that.k)
&& Objects.equals(innerQuery, that.innerQuery);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class RescoreVectorBuilder implements Writeable, ToXContentObject {
// Oversample is required as of now as it is the only field in the rescore vector
private final float numCandidatesFactor;

public RescoreVectorBuilder(Float numCandidatesFactor) {
public RescoreVectorBuilder(float numCandidatesFactor) {
Objects.requireNonNull(numCandidatesFactor, "[" + NUM_CANDIDATES_FACTOR_FIELD.getPreferredName() + "] must be set");
if (numCandidatesFactor < MIN_OVERSAMPLE) {
throw new IllegalArgumentException("[" + NUM_CANDIDATES_FACTOR_FIELD.getPreferredName() + "] must be >= " + MIN_OVERSAMPLE);
Expand Down Expand Up @@ -79,7 +79,7 @@ public int hashCode() {
return Objects.hashCode(numCandidatesFactor);
}

public Float numCandidatesFactor() {
public float numCandidatesFactor() {
return numCandidatesFactor;
}
}

0 comments on commit a256de9

Please sign in to comment.