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.
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
MATCHon 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
KNNfunction 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
MATCHwhen using a semantic_text field to ensure filtering is consistent when filters can't be pushed down.