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

Refactor core index/query time properties into FieldType #11422

Merged
merged 3 commits into from Jun 3, 2015

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented May 29, 2015

Mappers are currently used at both index and query time for deciding
how to "use" a field. For #8871, we need the index wide view of
mappings to have a unified set of settings for each field of a given
name within the index.

This change moves all the current settings (and methods defining
query time behavior) into subclasses of FieldType. In a future
PR, this will allow storing the field type at the index level,
instead of mappers (which can still have settings that differ
per document type).

The change is quite large (I'm sorry). I could not see a way to
migrate to this in a more piecemeal way. I did leave out cutting
over callers of the query methods to using the field type, as
that can be done in a follow up.

Mappers are currently used at both index and query time for deciding
how to "use" a field.  For elastic#8871, we need the index wide view of
mappings to have a unified set of settings for each field of a given
name within the index.

This change moves all the current settings (and methods defining
query time behavior) into subclasses of FieldType. In a future
PR, this will allow storing the field type at the index level,
instead of mappers (which can still have settings that differ
per document type).

The change is quite large (I'm sorry). I could not see a way to
migrate to this in a more piecemeal way. I did leave out cutting
over callers of the query methods to using the field type, as
that can be done in a follow up.
@rjernst rjernst added v2.0.0-beta1 :Search/Mapping Index mappings, including merging and defining field types labels May 29, 2015
@rjernst
Copy link
Member Author

rjernst commented May 29, 2015

I should clarify, this moves all settings that affects query time behavior. So if something affects only indexing (eg coerce setting for numeric fields), it is left in the mapper.

@clintongormley
Copy link

@jpountz, @imotov, @javanna your eyes would be greatly appreciated

@jpountz
Copy link
Contributor

jpountz commented May 30, 2015

LGTM I like where this is going

/**
* This defines the core properties and functions to operate on a field.
*/
public class MappedFieldType extends FieldType {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this class somehow validate if all required members are set when it's frozen. IE we need analyzer and names to work no?

@s1monw
Copy link
Contributor

s1monw commented May 30, 2015

it's a pretty big change and hard to review but I second @jpountz here this looks good and goes into the right direction. I left some minor comments regarding tests and assertions... otehr than that LGTM

rjernst added a commit that referenced this pull request Jun 3, 2015
Mappings: Refactor core index/query time properties into FieldType
@rjernst rjernst merged commit a3f5154 into elastic:master Jun 3, 2015
@rjernst rjernst removed the review label Jun 3, 2015
@rjernst rjernst deleted the pr/fieldtype-mapper-split branch June 3, 2015 10:10
@clintongormley clintongormley changed the title Mappings: Refactor core index/query time properties into FieldType Refactor core index/query time properties into FieldType Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Mapping Index mappings, including merging and defining field types v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants