Skip to content

MappedFieldType should not extend FieldType (#57666) #58160

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

Merged
merged 10 commits into from
Jun 16, 2020

Conversation

romseygeek
Copy link
Contributor

MappedFieldType is a combination of two concerns:

  • an extension of lucene's FieldType, defining how a field should be indexed
  • a set of query factory methods, defining how a field should be searched

We want to break these two concerns apart. This commit is a first step to doing this, breaking
the inheritance relationship between MappedFieldType and FieldType. MappedFieldType
instead has a series of boolean flags defining whether or not the field is searchable or
aggregatable, and FieldMapper has a separate FieldType passed to its constructor defining
how indexing should be done.

Relates to #56814

MappedFieldType is a combination of two concerns:

* an extension of lucene's FieldType, defining how a field should be indexed
* a set of query factory methods, defining how a field should be searched

We want to break these two concerns apart. This commit is a first step to doing this, breaking
the inheritance relationship between MappedFieldType and FieldType. MappedFieldType
instead has a series of boolean flags defining whether or not the field is searchable or
aggregatable, and FieldMapper has a separate FieldType passed to its constructor defining
how indexing should be done.

Relates to elastic#56814
@romseygeek romseygeek added :Search Foundations/Mapping Index mappings, including merging and defining field types >refactoring backport v7.9.0 labels Jun 16, 2020
@romseygeek romseygeek self-assigned this Jun 16, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 16, 2020
@romseygeek
Copy link
Contributor Author

This is a reasonably complex backport of #57666, so I've opened a PR to let CI chew it over.

extends FieldMapper.Builder<T> {
protected Boolean ignoreMalformed;
protected Boolean ignoreZValue;
protected boolean indexed = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that this pull request causes #69401? In 7.9.0 geo_point fields are always indexed, that is a regression, since it was possible to make geo_point fields not indexable in earlier versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport >refactoring :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants