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

Allow script to have string or object value #2960

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

l-trotta
Copy link
Contributor

Originally reported as a Java Client issue.

PutScript API support either the source of the script as a string, or as a Search Template object, which is equivalent to the whole SearchRequest body.

Since the Search Request body is also needed by Multisearch, it was extracted as a separate class in the search package to that both Multisearch and StoredScript can use it (it was also ordered alphabetically).

source in StoredScript is now an externally tagged union. (potentially breaking for generators)

Ideally nothing else should be changed in the client codes as a result of this PR except for StoredScript, I'm setting this up as a draft for now, let me know when the generators are ready.

Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
msearch 🟢 17/17 16/16
search 🔴 2204/2262 2243/2244

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

@l-trotta l-trotta marked this pull request as draft September 27, 2024 15:14
@technige technige added the tracking Tracking in DevTools roadmap label Oct 4, 2024
Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Since this does not affect elasticsearch-py, I'm approving.

However since it could affect elasticsearch-dsl-py, I added @miguelgrinberg to the list of reviewers.

Copy link
Contributor

@miguelgrinberg miguelgrinberg left a comment

Choose a reason for hiding this comment

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

LGTM. And the Python DSL client is not affected by this change.

@l-trotta
Copy link
Contributor Author

thank you both! I'll remember the python dsl for future issues

@JoshMock
Copy link
Member

Shouldn't cause any issues for the JS generator either. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
specification tracking Tracking in DevTools roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants