Skip to content

Updated ES specification to support simplified retrievers #4912

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

Merged
merged 1 commit into from
Jul 14, 2025

Conversation

mridula-s109
Copy link
Contributor

This PR introduces the following optional fields to specification/_types/Retriever.ts:

  • LinearRetriever:
    • query?: string: A query string for a text-based search.
    • fields?: string[]: The fields to run the query against.
    • normalizer?: ScoreNormalizer: The normalizer to use for scoring.
  • RRFRetriever:
    • query?: string: A query string for a text-based search.
    • fields?: string[]: The fields to run the query against.

These additions allow users to specify a simple query string directly within the retriever, aligning it with recent changes made in the Kibana Dev Console (SEARCH-1091).

Validation

The specification was validated against the search API using make validate api=search branch=main.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds optional query parameters to the ES specification retrievers, enabling simplified text-based searches directly in the retriever definitions.

  • Introduces query, fields, and normalizer to LinearRetriever
  • Introduces query and fields to RRFRetriever
  • Aligns the specification with recent Kibana Dev Console changes for simplified retrievers
Comments suppressed due to low confidence (6)

specification/_types/Retriever.ts:72

  • Add a JSDoc comment for query to explain its purpose, e.g.: /** A query string for a text-based search. */
  query?: string

specification/_types/Retriever.ts:73

  • Add a JSDoc comment for fields to describe which document fields are searched, e.g.: /** The fields to run the query against. */
  fields?: string[]

specification/_types/Retriever.ts:74

  • Add a JSDoc comment for normalizer, e.g.: /** The normalizer to use for scoring. */, and verify that ScoreNormalizer is imported or defined above.
  normalizer?: ScoreNormalizer

specification/_types/Retriever.ts:142

  • Add a JSDoc comment for query in RRFRetriever, e.g.: /** A query string for a text-based search. */
  query?: string

specification/_types/Retriever.ts:143

  • Add a JSDoc comment for fields in RRFRetriever, e.g.: /** The fields to run the query against. */
  fields?: string[]

specification/_types/Retriever.ts:72

  • No tests appear to cover the new query, fields, and normalizer properties; please add validation tests to ensure they are correctly serialized and validated in the API schema.
  query?: string

Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

Copy link

@Mikep86 Mikep86 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mridula-s109 mridula-s109 merged commit 177af77 into main Jul 14, 2025
14 checks passed
@mridula-s109 mridula-s109 deleted the SEARCH-1093-simplified-retrievers-upstream branch July 14, 2025 18:50
github-actions bot pushed a commit that referenced this pull request Jul 14, 2025
github-actions bot pushed a commit that referenced this pull request Jul 14, 2025
mridula-s109 added a commit that referenced this pull request Jul 15, 2025
mridula-s109 added a commit that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants