Skip to content

Commit 10ce6fc

Browse files
authored
Merge branch 'main' into changelogs-08-04
2 parents 11b5248 + 5004bcd commit 10ce6fc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,6 @@ tests:
592592
- class: org.elasticsearch.xpack.esql.qa.single_node.EsqlSpecApproximationBucketIncludeEmptyBucketsIT
593593
method: test {csv-spec:bucket_include_empty_buckets.Large number of buckets doesn't OOM - stats}
594594
issue: https://github.com/elastic/elasticsearch/issues/155921
595-
- class: org.elasticsearch.index.codec.vectors.cluster.FloatHierarchicalKMeansTests
596-
method: testSoarAssignmentsValidAfterEmptyClusterRemoval
597-
issue: https://github.com/elastic/elasticsearch/issues/155931
598595
- class: org.elasticsearch.test.rest.ClientYamlTestSuiteIT
599596
method: test {yaml=search.highlight/70_number_of_fragments/number_of_fragments at the maximum should SUCCEED}
600597
issue: https://github.com/elastic/elasticsearch/issues/155969

server/src/main/java/org/elasticsearch/index/codec/vectors/cluster/Soar.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ private static <V> int computeSoarAssignment(
202202
float[] distances,
203203
CentroidOps<V> ops
204204
) {
205+
if (centroidCount <= 0) {
206+
// no other centroid available to spill to (e.g. an empty neighborhood after empty-cluster removal)
207+
return NO_SOAR_ASSIGNMENT;
208+
}
205209
V currentCentroid = centroids[currAssignment];
206210
float vectorCentroidDist = ops.squareDistance(vector, currentCentroid);
207211
if (vectorCentroidDist <= SOAR_MIN_DISTANCE) {

0 commit comments

Comments
 (0)