Skip to content

Make MappedFieldType responsible for providing a parser/formatter.#17546

Merged
jpountz merged 2 commits intoelastic:masterfrom
jpountz:enhancement/fieldtype_format
Apr 7, 2016
Merged

Make MappedFieldType responsible for providing a parser/formatter.#17546
jpountz merged 2 commits intoelastic:masterfrom
jpountz:enhancement/fieldtype_format

Conversation

@jpountz
Copy link
Copy Markdown
Contributor

@jpountz jpountz commented Apr 5, 2016

Aggregations need to perform instanceof calls on MappedFieldType instances in
order to know how they should be parsed or formatted. Instead, we should let
the field types provide a formatter/parser that can can be used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we add a test of this method in BytesStreamTests? (see comment here: #17351 (comment))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added serialization tests, but in a dedicated test in the same package as DocValeFormat so that I can assert on the value of pkg protected fields without exposing anything to the public

@colings86
Copy link
Copy Markdown
Contributor

@jpountz I left a few comments.

@jpountz jpountz force-pushed the enhancement/fieldtype_format branch from b0db200 to 3cbd49e Compare April 6, 2016 16:14
@jpountz
Copy link
Copy Markdown
Contributor Author

jpountz commented Apr 6, 2016

I pushed commits to address your comments.

@colings86
Copy link
Copy Markdown
Contributor

LGTM

jpountz added 2 commits April 7, 2016 16:57
…astic#17546

Aggregations need to perform instanceof calls on MappedFieldType instances in
order to know how they should be parsed or formatted. Instead, we should let
the field types provide a formatter/parser that can can be used.
@jpountz jpountz force-pushed the enhancement/fieldtype_format branch from 3cbd49e to c33300c Compare April 7, 2016 14:58
@jpountz jpountz merged commit c33300c into elastic:master Apr 7, 2016
nknize added a commit to nknize/elasticsearch that referenced this pull request May 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants