Skip to content

Updated ES specification to support simplified retrievers #4911

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

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 extends the Elasticsearch specification types to allow simple query-based retriever configurations.

  • Adds optional query, fields, and normalizer parameters to LinearRetriever
  • Adds optional query and fields parameters to RRFRetriever
Comments suppressed due to low confidence (6)

specification/_types/Retriever.ts:72

  • Add a JSDoc comment above query to describe its purpose and expected format, matching the style of existing field comments.
  query?: string

specification/_types/Retriever.ts:73

  • Add a JSDoc comment above fields to explain this array’s intended use and any constraints on field names.
  fields?: string[]

specification/_types/Retriever.ts:74

  • Add a JSDoc comment above normalizer to clarify which normalizer options are supported and how scoring is affected.
  normalizer?: ScoreNormalizer

specification/_types/Retriever.ts:142

  • Add a JSDoc comment above this query field in RRFRetriever, describing its role in the retrieval process.
  query?: string

specification/_types/Retriever.ts:143

  • Add a JSDoc comment above this fields array in RRFRetriever to explain how field selection affects result sets.
  fields?: string[]

specification/_types/Retriever.ts:72

  • Add or update unit tests (and integration tests if applicable) to cover the new query, fields, and normalizer options on both LinearRetriever and RRFRetriever.
  query?: string

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.

Looks like we need to use a branch in the elastic/elasticsearch-specification repo to get CI to pass

@mridula-s109
Copy link
Contributor Author

Looks like we need to use a branch in the elastic/elasticsearch-specification repo to get CI to pass

Thanks for bringing it to my notice. I thought there was a way around it, as there isnt have created a new PR from the main repo branch - #4912.

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