Skip to content

[ES|QL] Semantic (dense) MATCH queries with filters that aren't translatable to Lucene apply post knn query #139453

@dimitris-athanasiou

Description

@dimitris-athanasiou

Elasticsearch Version

9.3

Installed Plugins

No response

Java Version

bundled

OS Version

all

Problem Description

#138989 adds auto-prefiltering for MATCH queries on semantic_text fields that are using dense vectors.

However, filters that are not translatable to Lucene queries will not be pushed down, and thus will not apply prior to the knn query.

For KNN queries, this is solved by falling back to an EXACT NN. That would be one way to address this for MATCH too.

Steps to Reproduce

Example query:

FROM test_index
  | WHERE MAX(some_field, 10) == 10
  | WHERE MATCH(dense_semantic_field, "some query")

Logs (if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Relevance/ES|QLSearch functionality in ES|QL:Search Relevance/SearchCatch all for Search Relevance>bugTeam:Search RelevanceMeta label for the Search Relevance team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions