Skip to content

Conversation

@carlosdelest
Copy link
Member

Closes #137392

Addresses the following follow ups to #137002:

  • Do a single walk through the plan on the pushdown rule, similar to how ResolveUnionTypes work
  • As a consequence of the above, deduplicate fields in multiple commands when replacing expressions by pushed down fields
  • Implement canonicalize for vector similarity functions, and adds CanonicalizeVectorSimilarityFunctions rule to ensure canonicalization
  • BlockLoaderFunctionConfig now implements name(), to help create a distinct name for the pushed down FieldAttribute - which is needed in order not to have duplicate field names
  • Randomize tests for vector similarity functions pushdown

@carlosdelest carlosdelest added >non-issue :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch :Search Relevance/ES|QL Search functionality in ES|QL v9.3.0 labels Nov 4, 2025
similarityFunction.dataType(),
blockLoaderFunctionConfig
);
var name = rawTemporaryName(fieldAttr.name(), blockLoaderFunctionConfig.name());
Copy link
Member Author

Choose a reason for hiding this comment

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

Rely on blockLoaderFunctionConfig.name() to get a unique name for different functions

@carlosdelest
Copy link
Member Author

@elasticsearchmachine run elasticsearch-ci/bwc-snapshots-part3

@carlosdelest carlosdelest marked this pull request as ready for review November 4, 2025 11:37
@elasticsearchmachine elasticsearchmachine added the Team:Search - Relevance The Search organization Search Relevance team label Nov 4, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@Override
protected Expression rule(VectorSimilarityFunction vectorSimilarityFunction, LogicalOptimizerContext ctx) {
return vectorSimilarityFunction.canonical();
}
Copy link
Member

Choose a reason for hiding this comment

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

I had assumed there was already a rule for this!

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

Labels

>non-issue :Search Relevance/ES|QL Search functionality in ES|QL :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team 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.

ES|QL - Expression field loading follow ups

3 participants