Skip to content

update transformRangeFilterValue to use gte and lte over from and to #1160

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 3 commits into from
May 26, 2025

Conversation

samk1
Copy link
Contributor

@samk1 samk1 commented May 20, 2025

Before submitting this PR:

  1. Make sure you are PR'ing from a fork, please do not push branches directly
    to this repository.
  2. Ensure you've written sufficient tests for your work.
  3. Double check that your changes will not break existing connectors (if
    applicable).
  4. Double check that your changes do not break the react-search-ui-views
    storybook (if applicable).

Description

previously when this package leveraged searchkit set gte: and lte: inside the request body for range queries.
https://github.com/searchkit/searchkit/blob/3805f655363e8a72a534807026aee67d01536d3a/packages/searchkit-sdk/src/facets/MultiQueryOptionsFacet.ts#L20

Apparently there is an issue with the type declarations in @elastic/elasticsearch where it says from: and to: are valid properties of a range query (they aren't)
https://github.com/elastic/elasticsearch-js/blob/0a14ecca4e10f18ec25e358a38bdb23c44b0d374/src/api/types.ts#L9391

List of changes

This PR updates the transformRangeFilterValue to set gte and lte as required by the elasticsearch DSL.

Associated Github Issues

elastic/elasticsearch-js#2846

@samk1 samk1 requested a review from a team as a code owner May 20, 2025 07:05
Copy link

cla-checker-service bot commented May 20, 2025

💚 CLA has been signed

@samk1
Copy link
Contributor Author

samk1 commented May 20, 2025

CLA signed as an organisation and all contributors on this PR added as contributors

@samk1
Copy link
Contributor Author

samk1 commented May 20, 2025

Issue created in elasticsearch repository:
elastic/elasticsearch-js#2846

Copy link
Contributor

@yansavitski yansavitski left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you for fixing that

@yansavitski yansavitski merged commit cf3a9aa into elastic:main May 26, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants