Skip to content

Conversation

@john-wagster
Copy link
Contributor

@john-wagster john-wagster commented Sep 26, 2025

I double checked that we validate that -1 is allowed and accounted for. It indicates when a vector that's being considered for spilling is too close to a centroid to be given a SOAR assignment. So only needed to update the test.

fixes: #135538

…se to a centroid and we shouldn't assign them
@john-wagster john-wagster added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search v9.2.0 labels Sep 26, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Sep 26, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

Copy link
Contributor

@tteofili tteofili left a comment

Choose a reason for hiding this comment

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

LGTM, with a minor comment

// verify no duplicates exist
for (int i = 0; i < assignments.length; i++) {
assertTrue(soarAssignments[i] >= 0 && soarAssignments[i] < centroids.length);
assertTrue(soarAssignments[i] >= -1 && soarAssignments[i] < centroids.length);
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: I wonder if it's useful to move that special value into a constant, so that we can reuse the same "too close" value both in code and tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can do that real quick: 👍

@john-wagster john-wagster enabled auto-merge (squash) September 26, 2025 14:56
@john-wagster john-wagster merged commit 742b39b into elastic:main Sep 26, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] HierarchicalKMeansTests testFewDifferentValues failing

4 participants