elasticsearch/elasticsearch — pull request #7451 by brwe (2014-08-26 07:24:53+00:00)
Title: document field parsing: refactor to remove external value mechanism

I just make this pull request for having a better basis to discuss potential changes in the way external values are handled right now. I do not think it is ready for pulling in yet. Feel free to comment.

The external value mechanism was a workaround for not being able to set
a value while parsing a field value. It was used for example by geo point
to set the values for the lat and lon field. However, its the major
disadvantage was that it made the code hard to read.
This commit removes the external value from parse context and instead
adds a new method FieldMapper.addValue() which can be used to add fields
to a mapper that are unrelated to the currently parsed source.
In addition, this method is now used also by the multi_field handling so that
parsing is called only once and the parsed value (or any other) is passed
to multi_fields explicitely. Before, multi_fields relied on the parser
being at a particular position.
This means that now values which are objects or arrays in a json structure
can also be passed to multi_fields which was not possible before
(see BaseTypeMapperTests where all test except for testMultiFieldsWithArray
failed without this change).