Skip to content

Conversation

@carlosdelest
Copy link
Member

@carlosdelest carlosdelest commented Dec 11, 2025

Get the following vector similarity functions into release builds:

V_DOT_PRODUCT
V_COSINE
V_L1_NORM
V_L2_NORM
V_HAMMING

Vector similarity functions use function pushdown to blockloaders - see #137002

Other functions that use pushdown to blockloaders have been set behind a new capability so they will be pushed when all pending pushdown issues are addressed - see #137679 for this.

@carlosdelest carlosdelest added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch :Search Relevance/ES|QL Search functionality in ES|QL >enhancement labels Dec 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @carlosdelest, I've created a changelog YAML for you.

);
}

public void testVCosine() throws IOException {
Copy link
Member Author

Choose a reason for hiding this comment

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

Vector similarity functions tests have been moved to PushVectorSimilarityToLoadIT, as they don't need the check now. We should merge them together again when pushing down is not behind snapshot.


@Override
public PushedBlockLoaderExpression tryPushToFieldLoading(SearchStats stats) {
if (EsqlCapabilities.Cap.BLOCK_LOADER_EXPRESSIONS_PUSHDOWN.isEnabled() == false) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Checks pushdown capability on the pushdown for all the non-vector similarity functions

def(Magnitude.class, Magnitude::new, "v_magnitude"),
def(Hamming.class, Hamming::new, "v_hamming") } };
// dense vector functions
def(Magnitude.class, Magnitude::new, "v_magnitude")} };
Copy link
Member Author

Choose a reason for hiding this comment

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

V_MAGNITUDE is still not pushed down - #137535 tracks that

new InferIsNotNull(),
new InferNonNullAggConstraint(),
new ReplaceDateTruncBucketWithRoundTo(),
new PushExpressionsToFieldLoad()
Copy link
Member Author

Choose a reason for hiding this comment

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

Add the PushExpressionsToFieldLoad rule by default - now the BlockLoaderExpression.tryPushToFieldLoading method needs to take into account pushdown capabilities

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

@github-actions
Copy link
Contributor

ℹ️ Important: Docs version tagging

👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version.

We use applies_to tags to mark version-specific features and changes.

Expand for a quick overview

When to use applies_to tags:

✅ At the page level to indicate which products/deployments the content applies to (mandatory)
✅ When features change state (e.g. preview, ga) in a specific version
✅ When availability differs across deployments and environments

What NOT to do:

❌ Don't remove or replace information that applies to an older version
❌ Don't add new information that applies to a specific version without an applies_to tag
❌ Don't forget that applies_to tags can be used at the page, section, and inline level

🤔 Need help?

@carlosdelest carlosdelest marked this pull request as ready for review December 11, 2025 14:38
@elasticsearchmachine elasticsearchmachine removed the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 11, 2025
@carlosdelest carlosdelest requested a review from nik9000 December 11, 2025 14:38
@elasticsearchmachine
Copy link
Collaborator

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

Comment on lines +2716 to -2727
checkVectorFunctionsNullArgs("v_magnitude(null)");
if (EsqlCapabilities.Cap.MAGNITUDE_SCALAR_VECTOR_FUNCTION.isEnabled()) {
checkVectorFunctionsNullArgs("v_magnitude(null)");
}
if (EsqlCapabilities.Cap.HAMMING_VECTOR_SIMILARITY_FUNCTION.isEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think something is not right here - shouldn't v_magnitude tests still be skipped for non snapshot builds and the v_hamming ones be executed without a cap check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Relevance/ES|QL Search functionality in ES|QL Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants