Skip to content

ES|QL - MATCH function with semantic_text fields with non pushable filters #139754

@carlosdelest

Description

@carlosdelest

Description

Match query works with semantic_text fields in the query DSL and it applies prefiltering to other bool queries used with it (#132068).

When using MATCH on semantic_text fields on ES|QL, it is possible that other filters are not pushable to Lucene. This means that they won't be included in the bool query that will be issued to Lucene, and thus won't be applied as pre-filters.

The way around this for the KNN function was to change the KNN query into an exact query, and apply the non-pushable filters as post-filters (see #132944). Having KNN as an exact search function means we will find as much results as needed and the non-pushable filters will be applied, but as much results as possible will be retrieved back.

We can apply the same mechanism to MATCH when using a semantic_text field to ensure filtering is consistent when filters can't be pushed down.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions