Enable collapse on unsigned_long field#63495
Merged
mayya-sharipova merged 3 commits intoelastic:masterfrom Oct 16, 2020
Merged
Conversation
Collapse was not working on unsigned_long field, as collapsing was enabled only on KeywordFieldType and NumberFieldType. This introduces a new method `collapseType` to MappedFieldType, that is checked to decide if collapsing should be enabled. Relates to elastic#60050
Collaborator
|
Pinging @elastic/es-search (:Search/Mapping) |
Contributor
Author
|
@elasticmachine run elasticsearch-ci/packaging-sample-windows |
cbuescher
reviewed
Oct 14, 2020
Member
cbuescher
left a comment
There was a problem hiding this comment.
This looks good, I only left one comment regarding error messages.
| throw new IllegalArgumentException("unknown type for collapse field `" + field + | ||
| "`, only keywords and numbers are accepted"); | ||
| if (fieldType.collapseType() == CollapseType.NONE) { | ||
| throw new IllegalArgumentException("collapse is not supported on this field type"); |
Member
There was a problem hiding this comment.
Should we keep adding the field name to the error message to make it more actionable? Maybe we also have the actual field type available here to add to the error?
Contributor
Author
There was a problem hiding this comment.
@cbuescher Thanks for the feedback, addressed in 621992c
cbuescher
approved these changes
Oct 16, 2020
Member
cbuescher
left a comment
There was a problem hiding this comment.
Thanks for the changes, LGTM
mayya-sharipova
added a commit
to mayya-sharipova/elasticsearch
that referenced
this pull request
Oct 16, 2020
Collapse was not working on unsigned_long field, as collapsing was enabled only on KeywordFieldType and NumberFieldType. This introduces a new method `collapseType` to MappedFieldType, that is checked to decide if collapsing should be enabled. Relates to elastic#60050
mayya-sharipova
added a commit
that referenced
this pull request
Oct 16, 2020
Collapse was not working on unsigned_long field, as collapsing was enabled only on KeywordFieldType and NumberFieldType. This introduces a new method `collapseType` to MappedFieldType, that is checked to decide if collapsing should be enabled. Relates to #60050
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.
Collapse was not working on unsigned_long field,
as collapsing was enabled only on KeywordFieldType and NumberFieldType.
This introduces a new method
collapseTypeto MappedFieldType,that is checked to decide if collapsing should be enabled.
Relates to #60050