[KQL] Don't put KQL in filter but in Query #86365
Labels
Feature:KQL
KQL
impact:low
Addressing this issue will have a low level of impact on the quality/strength of our product.
loe:medium
Medium Level of Effort
Currently when using KQL it will be put into a bool filter and not the query. Thus it's not possible to use KQL input for relevance matching and using it to get a good
_score
. We would like to improve scoring in Discover (e.g. by sorting by default by score if the user entered a query: #54362), but with KQL this does not work (while it did with Lucene).I think the consumer of
SearchSource.setField('query')
should either have control over whether it will be put into filter or query, or always be put into query (and instead usesetField('filter')
for filters. I see a lot of use-cases where we might want to use KQL purely for filtering and never care about the score, thus I think it would be better to make it configurable by the consumer.The text was updated successfully, but these errors were encountered: