Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce first query #52482

Open
mayya-sharipova opened this issue Feb 18, 2020 · 4 comments
Open

Introduce first query #52482

mayya-sharipova opened this issue Feb 18, 2020 · 4 comments
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Feb 18, 2020

This is related to #42811 – deprecation of the function_score query.
funciton_score query had a unique functionality – first, that is not present in the current query DSL.

A proposal is to implement this functionality through a dedicated query type.
This query evaluates the child queries in order, and for a document returns the score of the first matching query.

{
  "query": {
    "first": {
      "queries": [
        {
          "match": {"message": "elasticsearch"}
        },
        {
         "match": {"author": "kibana"}
        }
      ]
    }
  }
}

Other name proposals:

  • first_in_order
  • first_matching
  • first_scoring
@mayya-sharipova mayya-sharipova added >feature :Search/Search Search-related issues that do not fall into other categories labels Feb 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this issue Feb 24, 2020
This introduces first query that allows to apply
score from the first matching query:

```js
{
  "query": {
    "first": {
      "queries": [
        {
          "match": {"message": "elasticsearch"}
        },
        {
         "match": {"author": "kibana"}
        }
      ]
    }
  }
}
```
first query allows to deprecate function_score query.

closes elastic#52482
@rjernst rjernst added the Team:Search Meta label for search team label May 4, 2020
mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this issue Jun 17, 2022
We had a plan to deprecate function_score query with
script_score query, but ran into a roadblock of missing
functionality to combine scores from different
functions (particularly "first" script_score).
Wee have several proposal to address this missing
functionality:
 [scripted_boolean](elastic#27588 (comment))
 [compound_query](elastic#51967)
 [first_query](elastic#52482)

But for now, we decided not to deprecate function_score query,
and hence we need to remove any mention that we are deprecating it.

Relates to elastic#42811
Closes elastic#71934
mayya-sharipova added a commit that referenced this issue Jun 17, 2022
We had a plan to deprecate function_score query with
script_score query, but ran into a roadblock of missing
functionality to combine scores from different
functions (particularly "first" script_score).
Wee have several proposal to address this missing
functionality:
 [scripted_boolean](#27588 (comment))
 [compound_query](#51967)
 [first_query](#52482)

But for now, we decided not to deprecate function_score query,
and hence we need to remove any mention that we are deprecating it.

Relates to #42811
Closes #71934
mayya-sharipova added a commit that referenced this issue Jun 17, 2022
We had a plan to deprecate function_score query with
script_score query, but ran into a roadblock of missing
functionality to combine scores from different
functions (particularly "first" script_score).
Wee have several proposal to address this missing
functionality:
 [scripted_boolean](#27588 (comment))
 [compound_query](#51967)
 [first_query](#52482)

But for now, we decided not to deprecate function_score query,
and hence we need to remove any mention that we are deprecating it.

Relates to #42811
Closes #71934
mayya-sharipova added a commit that referenced this issue Jun 17, 2022
We had a plan to deprecate function_score query with
script_score query, but ran into a roadblock of missing
functionality to combine scores from different
functions (particularly "first" script_score).
Wee have several proposal to address this missing
functionality:
 [scripted_boolean](#27588 (comment))
 [compound_query](#51967)
 [first_query](#52482)

But for now, we decided not to deprecate function_score query,
and hence we need to remove any mention that we are deprecating it.

Relates to #42811
Closes #71934
@mayya-sharipova
Copy link
Contributor Author

Relates to #49761 but addresses in for more general use cases where filters can't be expressed through script.

@elasticsearchmachine
Copy link
Collaborator

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

@benwtrent benwtrent added :Search Relevance/Ranking Scoring, rescoring, rank evaluation. and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 12, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 12, 2024
@elasticsearchmachine
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants