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

Adding script support for version parts #62953

Closed
wants to merge 1 commit into from

Conversation

cbuescher
Copy link
Member

Spin off of #59773 that factors out adding support to access special information about a version field value via scripts.
This is only one potential solution, so mainly opening this for discussion.

@mayya-sharipova
Copy link
Contributor

mayya-sharipova commented Sep 30, 2020

Thanks @cbuescher. This change LGTM!
I wonder if @jimczi has any objections to it.

Also you mentioned that it is one potential solution. What's another? Is it indexing these fields explicitly?

@cbuescher
Copy link
Member Author

Also you mentioned that it is one potential solution. What's another? Is it indexing these fields explicitly?

That would be one other option, also using runtime fields for this comes into mind, which would potentially be slower but would allow the same kind of operations for versions currently stored in ' keyword' fields I think. I think this can be discussed in #62952 before proceeding but thanks for the review.

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

I left one comment regarding where and how we could apply these functions.

@@ -55,4 +56,63 @@ public String get(int index) {
public int size() {
return count;
}

public boolean isValid() {
Copy link
Contributor

Choose a reason for hiding this comment

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

VersionScriptDocValues is a list so I don't think this is the right level to apply the functions. We accept multiple values so there should be a way to apply these functions to the first, second or last entry in the list too ?
These functions could also be applied to any string (keyword family) field ? A static function likesemverIsRelease(String) that would work on the decoded version could also be helpful imo, we don't need to put these functions under the new script values.

@elasticsearchmachine elasticsearchmachine changed the base branch from master to main July 22, 2022 23:12
@cbuescher
Copy link
Member Author

This PR is hopelessly outdated, so closing it.

@cbuescher cbuescher closed this May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants