Script: fields API for x-pack version, doc version, seq no, mumur3#81476
Merged
stu-elastic merged 18 commits intoelastic:masterfrom Jan 5, 2022
Merged
Script: fields API for x-pack version, doc version, seq no, mumur3#81476stu-elastic merged 18 commits intoelastic:masterfrom
stu-elastic merged 18 commits intoelastic:masterfrom
Conversation
Collaborator
|
Hi @stu-elastic, I've created a changelog YAML for you. |
…arch into pain_field_version
Contributor
Author
|
@elasticsearchmachine run elasticsearch-ci/part-2 |
Collaborator
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
49 tasks
jdconrad
approved these changes
Jan 5, 2022
Contributor
jdconrad
left a comment
There was a problem hiding this comment.
LGTM! Left a few minor comments.
| @Override | ||
| public Map<ScriptContext<?>, List<Whitelist>> getContextWhitelists() { | ||
| List<Whitelist> whitelist = singletonList(WHITELIST); | ||
| return Map.of( |
Contributor
There was a problem hiding this comment.
Do we know what the behavior of murmur3 is in contexts where it was previously available as a long, but not available as one of the contexts here?
Contributor
Author
There was a problem hiding this comment.
Added all core contexts and added #82289
| @Override | ||
| public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { | ||
| return builder.value(this.toString()); | ||
| return builder.value(toString()); |
Contributor
There was a problem hiding this comment.
Was this changed intentionally?
|
|
||
| /** | ||
| * Script value class. | ||
| * TODO(stu): implement {@code Comparable<Version>} based on {@code VersionEncoder#prefixDigitGroupsWithLength(String, BytesRefBuilder)} |
astefan
pushed a commit
to astefan/elasticsearch
that referenced
this pull request
Jan 7, 2022
…lastic#81476) Adds scripting fields API support the rest of the long fields: * [`_version`](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-versioning) - `VersionDocValuesField` * [`_seq_no`](https://www.elastic.co/guide/en/elasticsearch/reference/master/optimistic-concurrency-control.html) - `SeqNoDocValuesField` * [`murmur3`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-murmur3-usage.html) - `Murmur3DocValueField` * Added Painless support to the murmur3 mapper plugin. All `SortedNumericDocValues` that are interpreted as longs are now subclasses of `AbstractLongDocValuesField`, including murmur, doc version and seq no above as well as `LongDocValuesField` and `UnsignedLongDocValuesField` Also adds: * [x-pack's version](https://www.elastic.co/guide/en/elasticsearch/reference/master/version.html) - `VersionStringDocValuesField` * Created new `Version` value type as a location for future helpers for comparing versions. * Implements `toString` for the expected representation of the version * Implements `asString(String)` and `asString(int, String)`, `asStrings()` converters on field. Refs: elastic#79105
astefan
pushed a commit
to astefan/elasticsearch
that referenced
this pull request
Jan 7, 2022
…lastic#81476) Adds scripting fields API support the rest of the long fields: * [`_version`](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-versioning) - `VersionDocValuesField` * [`_seq_no`](https://www.elastic.co/guide/en/elasticsearch/reference/master/optimistic-concurrency-control.html) - `SeqNoDocValuesField` * [`murmur3`](https://www.elastic.co/guide/en/elasticsearch/plugins/current/mapper-murmur3-usage.html) - `Murmur3DocValueField` * Added Painless support to the murmur3 mapper plugin. All `SortedNumericDocValues` that are interpreted as longs are now subclasses of `AbstractLongDocValuesField`, including murmur, doc version and seq no above as well as `LongDocValuesField` and `UnsignedLongDocValuesField` Also adds: * [x-pack's version](https://www.elastic.co/guide/en/elasticsearch/reference/master/version.html) - `VersionStringDocValuesField` * Created new `Version` value type as a location for future helpers for comparing versions. * Implements `toString` for the expected representation of the version * Implements `asString(String)` and `asString(int, String)`, `asStrings()` converters on field. Refs: elastic#79105
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds scripting fields API support the rest of the long fields:
_version-VersionDocValuesField_seq_no-SeqNoDocValuesFieldmurmur3-Murmur3DocValueFieldAll
SortedNumericDocValuesthat are interpreted as longs are now subclasses ofAbstractLongDocValuesField, including murmur, doc version and seq no above as well asLongDocValuesFieldandUnsignedLongDocValuesFieldAlso adds:
VersionStringDocValuesFieldVersionvalue type as a location for future helpers for comparing versions.toStringfor the expected representation of the versionasString(String)andasString(int, String),asStrings()converters on field.Refs: #79105