Skip to content

New rescorer based on script#74274

Merged
elasticsearchmachine merged 28 commits intoelastic:mainfrom
limingnihao:script_rescorer
Aug 21, 2025
Merged

New rescorer based on script#74274
elasticsearchmachine merged 28 commits intoelastic:mainfrom
limingnihao:script_rescorer

Conversation

@limingnihao
Copy link
Copy Markdown
Contributor

@limingnihao limingnihao commented Jun 18, 2021

Introduce a new rescorer based on script.
A script can use scores from the previous query/rescorer.

For example:

GET books_index /_search
{
  "query": {
    "match": {
      "title": {
        "query": "ethics of ambiguity"
      }
    }
  },
  "rescore": {
    "window_size": 5,
    "script": {
      "script": {
        "source": "_score + (doc['num_likes'].value + doc['num_reviews'].value) * params.multiplier",
        "params": {
          "multiplier": 12
        }
      }
    }
  }
}

Closes #52338

@cla-checker-service
Copy link
Copy Markdown

cla-checker-service bot commented Jun 18, 2021

💚 CLA has been signed

@elasticsearchmachine elasticsearchmachine added the external-contributor Pull request authored by a developer outside the Elasticsearch team label Jun 18, 2021
@limingnihao
Copy link
Copy Markdown
Contributor Author

/test

@mark-vieira mark-vieira added the :Search Relevance/Ranking Scoring, rescoring, rank evaluation. label Jun 25, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 25, 2021
@elasticmachine
Copy link
Copy Markdown
Collaborator

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

@elasticsearchmachine elasticsearchmachine changed the base branch from master to main July 22, 2022 23:11
@amylashley
Copy link
Copy Markdown

Curious if there is any plan to merge this in the near future? It would be incredibly helpful for my work!

@jdconrad
Copy link
Copy Markdown
Contributor

@javanna Any thoughts on possibly reviving this pr?

@javanna
Copy link
Copy Markdown
Contributor

javanna commented Jan 18, 2023

I am +1 on reviving this, we just did not get to it until now, sadly.

@davefernig
Copy link
Copy Markdown

davefernig commented Nov 14, 2023

I have two questions about this PR:

  1. What is the expected behaviour in the case in which the argument to rescore is an array? Will _score refer to the score from the previous stage – whatever that happens to be? (In my case that would be great). The concrete example I'm interested in consists in two rescore stages:
  • The first of which implements the sltr query of the elasticsearch-learning-to-rank plugin
  • The second implements a sigmoid transform
{
  "size": 50,
  "query": {"match": {"title": {"query": "raymond chandler"}}},
  "rescore": [
    {
      "window_size": 500,
      "query": {
        "rescore_query": {
          "sltr": {
            "params": {
              "query_string": "raymond chandler"
            },
            "model": "lambdamart_v001",
            "cache": true
          }
        },
        "rescore_query_weight": 1,
        "query_weight": 0
      }
    },
    {
      "window_size": 50,
      "script": {
        "lang": "painless",
        "source": "source": "1.0 / (1.0 + Math.exp(0-_score))"
      }
    }
  ]
}

My hope is that the resulting scores at the end of this will be whatever SLTR returns, pushed through a sigmoid. (This can't be done in a single step, for the reason discussed here: o19s/elasticsearch-learning-to-rank#121 (comment) )

  1. If the answer to 1 is "yes, this commit will solve all your problems," do we have a sense of if/when this will get merged?

cc @javanna @jdconrad

@javanna javanna added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 16, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@mayya-sharipova mayya-sharipova self-assigned this Aug 14, 2025
@mayya-sharipova mayya-sharipova self-requested a review August 14, 2025 12:33
@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine generate changelog

@mayya-sharipova mayya-sharipova changed the title Rescorer support script. #52338 New rescorer based on script Aug 14, 2025

@Override
public TransportVersion getMinimalSupportedVersion() {
return TransportVersions.SCRIPT_RESCORER;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question for my knowledge. I'm only somewhat familiar with Transport Versions. What does this protect? Does this mean we can only support this syntax in the next release forward? And why is that in this case as in is it possible to have some new Builder where the minimal supported version is any version?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. This ensures that node that de-serializes this request has the provided min version. If it doesn't, the request with a script rescorer fails (I think with IllegalArgumentException).
We could potentially add some logic, if the deserialization happens on an older node, convert it to query rescorer, but I think it makes the code more complicated for little added advantage: supporting mixed cluster scenarios.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense thanks!

Copy link
Copy Markdown
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine test this please

@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine test this please

@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine test this please

@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine test this please

@mayya-sharipova
Copy link
Copy Markdown
Contributor

@elasticmachine test this please

@elasticsearchmachine elasticsearchmachine merged commit 759a2b6 into elastic:main Aug 21, 2025
35 checks passed
mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this pull request Aug 21, 2025
PR elastic#74274 introduced a new rescorer based on script.
This adds a documenation for this rescorer.
mayya-sharipova added a commit to mayya-sharipova/elasticsearch that referenced this pull request Aug 21, 2025
PR elastic#74274 introduced a new rescorer based on script.
This adds a documentation for this rescorer.
mayya-sharipova added a commit to mayya-sharipova/elasticsearch-specification that referenced this pull request Sep 17, 2025
pquentin pushed a commit to elastic/elasticsearch-specification that referenced this pull request Sep 18, 2025
pquentin pushed a commit to elastic/elasticsearch-specification that referenced this pull request Oct 7, 2025
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 9, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 11, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
(cherry picked from commit 7b7e18a)

# Conflicts:
#	compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
#	specification/streams/logs_disable/StreamsLogsDisableRequest.ts
#	specification/streams/logs_enable/StreamsLogsEnableRequest.ts
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 11, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
(cherry picked from commit 7b7e18a)

# Conflicts:
#	compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
#	specification/inference/put_groq/PutGroqRequest.ts
#	specification/inference/put_nvidia/PutNvidiaRequest.ts
#	specification/streams/logs_disable/StreamsLogsDisableRequest.ts
#	specification/streams/logs_enable/StreamsLogsEnableRequest.ts
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 11, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
(cherry picked from commit 7b7e18a)

# Conflicts:
#	compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
#	specification/inference/put_groq/PutGroqRequest.ts
#	specification/inference/put_nvidia/PutNvidiaRequest.ts
#	specification/streams/logs_disable/StreamsLogsDisableRequest.ts
#	specification/streams/logs_enable/StreamsLogsEnableRequest.ts
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 11, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
(cherry picked from commit 7b7e18a)

# Conflicts:
#	compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
#	specification/inference/put_groq/PutGroqRequest.ts
#	specification/inference/put_nvidia/PutNvidiaRequest.ts
#	specification/streams/logs_disable/StreamsLogsDisableRequest.ts
#	specification/streams/logs_enable/StreamsLogsEnableRequest.ts
pquentin added a commit to elastic/elasticsearch-specification that referenced this pull request Mar 11, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
(cherry picked from commit 7b7e18a)

# Conflicts:
#	compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
#	specification/streams/logs_disable/StreamsLogsDisableRequest.ts
#	specification/streams/logs_enable/StreamsLogsEnableRequest.ts
gmjehovich pushed a commit to elastic/elasticsearch-specification that referenced this pull request Apr 13, 2026
* Add initial rest-api-spec converter

* Wrap JSON data with endpoint name

* Add headers

* Extract visibility

* Add debug logging for types

* Improve type handling

* Extract builting mappings

* Skip empty headers

* Add more mappings

* Add required field to bodies

* Support CommonCatQueryParameters

* Fix availability/stability

* Improve urls generation

* Serialize description only if required?

* Support more complex types

* Add spec and docs for new logs streams endpoints (#5258)

* Add spec and docs for new logs streams endpoints

* Add @codegen name to Acked responses

* Linting fix

* Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Correct feature flag

* Add doc-ids

* Fix doc-ids

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification/_doc_ids/table.csv

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Add default timeouts

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>

* Update specification output

* Add common cat API parameters for unit rendering (#5298)

Describes the `?bytes=` and `?time=` parameters which are accepted by
all the `GET _cat/...` APIs.

* Edit the log streams endpoint docs (#5305)

* Add speficaiton for a new rescore type (#5308)

Based on PR elastic/elasticsearch#74274

* Update specification output

* Update rest-api-spec (#5294)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Update rest-api-spec (#5311)

Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>

* Commit Cargo.lock changes

* Show unexpected union

* Remove '| string' in query parameters

* Always specify body.required

* Fix type for uint

* Return string for string | string[]

* Skip empty descriptions

* Remove redundant code comments

* Specify default_value for expand_wildcards

* Stop hardcoding expand_wildcards

* Improve union handling

* Hardcode "serialize": "bulk" endpoints

* Handle deprecated URLs parts

* Improve diff script

* Tweak converter

* Handle parameter visibility

* Handle required parameters

* Fix required parameters

* Fix experimental indices sample APIs

* Allow string[] for routing parameters

* Fix type of if_version in ingest.put_pipeline

* Fix type of search_type in rank_eval

* Fix type of CategoryId

* Mark find_structure column_names as string | string[]

* Allow empty URLs

* Handle number|string special cases

* Handle Fleet IndexName | IndexCase case

* Fail on unknown cases

* Improve diff

* Remvope file committed by mistake

* Add optional body to three ML APIs

* Fix ccs_minimize_roundtrips default value

* Fix description for parameter that does not accept comma-separated values

* Stop trying to document private API

* Remove parameter in find_structure API

* Fix find_stucture format enum

* Remove cruft

* Remove more cruft

* Update Rust edition to 2024 and refactor conditional statements

* Clarify main.rs

Print at the correct place and use crate prefixes

* Remove diplay() call

* Add TODOs

* Remove wrong doc_id from knn_search

* Add body to project.tags

* Run make spec-format-fix

* wip

* Switch to HttpMethod enum

* Use http::Method and implement TryFrom

* Use enums for stability and visibility

* Switch parameter types to enum

* Simplify BUILTING_MAPPINGS code

* Add top-level Cargo.lock change

* Add WASM integration for rest-api-spec generation

* Fix leftovers from previous commit

* Restrict WASM tracing to INFO

* Add _common.json generation

* Rename is_literal to get_literal

* Fix indices.get_settings expand_wildcards default

---------

Co-authored-by: Luke Whiting <luke.whiting@elastic.co>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com>
Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) external-contributor Pull request authored by a developer outside the Elasticsearch team >feature :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider support for a script rescorer

10 participants