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

Enable collapse on unsigned_long field #63495

Merged

Conversation

mayya-sharipova
Copy link
Contributor

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

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 mayya-sharipova added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Oct 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Oct 8, 2020
@mayya-sharipova mayya-sharipova added v8.0.0 v7.11.0 >enhancement and removed Team:Search Meta label for search team labels Oct 8, 2020
@mayya-sharipova mayya-sharipova changed the title Enabled collapse on unsigned_long field Enable collapse on unsigned_long field Oct 8, 2020
@mayya-sharipova
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/packaging-sample-windows

@mayya-sharipova mayya-sharipova added the Team:Search Meta label for search team label Oct 8, 2020
Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

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");
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cbuescher Thanks for the feedback, addressed in 621992c

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, LGTM

@mayya-sharipova mayya-sharipova merged commit 3d3837d into elastic:master Oct 16, 2020
@mayya-sharipova mayya-sharipova deleted the unsigned-long-make-collapsable branch October 16, 2020 14:06
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.11.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants