-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Store keyword fields that trip ignore_above in binary doc values #137483
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
Store keyword fields that trip ignore_above in binary doc values #137483
Conversation
2a64367 to
8bf42f4
Compare
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Show resolved
Hide resolved
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Outdated
Show resolved
Hide resolved
980e6c9 to
ffc2498
Compare
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
|
The test is failing bc its expecting duplicate values, but with this change we're now deduplicating multi-valued fields in the same document. This is done for better storage efficiency. We can either change the test or keep the duplicates. |
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Show resolved
Hide resolved
martijnvg
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.
Looks good left a few comments.
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java
Outdated
Show resolved
Hide resolved
...r/src/main/java/org/elasticsearch/index/mapper/BinaryDocValuesSyntheticFieldLoaderLayer.java
Show resolved
Hide resolved
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Show resolved
Hide resolved
...per-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java
Outdated
Show resolved
Hide resolved
b074b90 to
3d83988
Compare
3d83988 to
a1d1d2a
Compare
martijnvg
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.
Let's wait for compression of binary doc values to have been merged and its feature flag removed, otherwise LGTM
...les/mapper-extras/src/yamlRestTest/resources/rest-api-spec/test/match_only_text/10_basic.yml
Show resolved
Hide resolved
…stic#137483) * Store keyword fields that trip ignore_above in binary doc values * Addressed feedback * Moved ignore values doc value field fetcher inside of existing fetcher function
| b.utf8Value(ref.bytes, ref.offset, ref.length); | ||
| } | ||
| }); | ||
| layers.add(new BinaryDocValuesSyntheticFieldLoaderLayer(fieldName)); |
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.
Will this break BWC? Because old indices will have their ignored values stored in a stored field, and now the mapper can no longer load those values?
| context.doc().add(new StoredField(fieldName, bytesRef)); | ||
|
|
||
| // store the value in a binary doc values field, create one if it doesn't exist | ||
| MultiValuedBinaryDocValuesField field = (MultiValuedBinaryDocValuesField) context.doc().getByKey(fieldName); | ||
| if (field == null) { | ||
| field = new MultiValuedBinaryDocValuesField(fieldName); | ||
| context.doc().addWithKey(fieldName, field); | ||
| } | ||
| field.add(bytesRef); |
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.
Another BWC issue - old indices will have conflicting fieldinfos for <name>._original since we're switching from using a stored field to binary doc values.
…ues (elastic#137483)" This reverts commit 6783135.
https://github.com/elastic/logs-program/issues/13