-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Script: fields API for x-pack version, doc version, seq no, mumur3 #81476
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
|
Hi @stu-elastic, I've created a changelog YAML for you. |
…arch into pain_field_version
|
@elasticsearchmachine run elasticsearch-ci/part-2 |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
jdconrad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left a few minor comments.
| @Override | ||
| public Map<ScriptContext<?>, List<Whitelist>> getContextWhitelists() { | ||
| List<Whitelist> whitelist = singletonList(WHITELIST); | ||
| return Map.of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this changed intentionally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted.
|
|
||
| /** | ||
| * Script value class. | ||
| * TODO(stu): implement {@code Comparable<Version>} based on {@code VersionEncoder#prefixDigitGroupsWithLength(String, BytesRefBuilder)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address this TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added link to #82287 in TODO
…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
…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
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