This will We should allow some {{asXXX()}} methods in {{IndexSchemaFieldContext}} to return lead to accessors that do simply not just offer a {{write(DocumentElement target, T value)}} method. This can be useful for:
* Dynamic fields, where we'd rather need {{.name("theDynamicName").write(target, <some value>)}} * Exotic data types, such as geo_shapes, where we could accept more than one type: {{write(DocumentElement target, GeoCircle value)}}, {{write(DocumentElement target, GeoPolygon value)}}; or even custom-tailored methods avoiding the need of instantiating : {{writeCircle(DocumentElement target, GeoPoint center, double radius, DistanceUnit radiusUnit)}}, ...
I'm not saying we should absolutely implement the two items above, just that with the change proposed in this ticket, we could, and should make sure we could even can do it without breaking current APIs in later releases. So if something allows us to make APIs evolve without breaking them, it's probably a good thing. |
|