Skip to content

Commit 9596c7f

Browse files
committed
fixing version checks
1 parent 65944f9 commit 9596c7f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ static RescoreVector fromIndexOptions(Map<String, ?> indexOptionsMap, IndexVersi
20562056
throw new IllegalArgumentException("Invalid rescore_vector value. Missing required field " + OVERSAMPLE);
20572057
}
20582058
float oversampleValue = (float) XContentMapValues.nodeDoubleValue(oversampleNode);
2059-
if (oversampleValue == 0 && allowsZeroRescore(indexVersion)) {
2059+
if (oversampleValue == 0 && allowsZeroRescore(indexVersion) == false) {
20602060
throw new IllegalArgumentException("oversample must be greater than 1");
20612061
}
20622062
if (oversampleValue < 1 && oversampleValue != 0) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public RescoreVectorBuilder(StreamInput in) throws IOException {
5959
public void writeTo(StreamOutput out) throws IOException {
6060
// We don't want to serialize a `0` oversample to a node that doesn't know what to do with it.
6161
if (oversample == NO_OVERSAMPLE
62-
&& (out.getTransportVersion().before(RESCORE_VECTOR_ALLOW_ZERO)
63-
|| (out.getTransportVersion().isPatchFrom(RESCORE_VECTOR_ALLOW_ZERO_BACKPORT_8_19) == false))) {
62+
&& out.getTransportVersion().before(RESCORE_VECTOR_ALLOW_ZERO)
63+
&& out.getTransportVersion().isPatchFrom(RESCORE_VECTOR_ALLOW_ZERO_BACKPORT_8_19) == false) {
6464
throw new ElasticsearchStatusException(
6565
"[rescore_vector] does not support a 0 for ["
6666
+ OVERSAMPLE_FIELD.getPreferredName()

0 commit comments

Comments
 (0)