Add null_value support to geo_point type#29451
Conversation
Adds support for null_value attribute to the geo_point types. Closes elastic#12998
|
Pinging @elastic/es-search-aggs |
|
I'd like to understand what the use-case is for such a feature. I can understand how a default value equal to "n/a" can help on |
|
@kurtado, since you opened the original issue, could you comment on it? |
|
Sure, from what I recall, we had a customer in training who wished to set a default, exactly like this. I can't remember the exact use case, but a |
|
While reading the original discussion I was imagining a scenario of some large central location and satellite offices where most of the documents correspond to the main location but occasionally may contain alternative locations. So, I think in this scenario assigning them to the central location by default would make sense. |
jpountz
left a comment
There was a problem hiding this comment.
Fair enough. I doubt this will be used much, but at least this is consistent with other fields.
| public static GeoPoint parseGeoPoint(Object value, final boolean ignoreZValue) throws ElasticsearchParseException { | ||
| try { | ||
| XContentBuilder content = JsonXContent.contentBuilder(); | ||
| content.value(value); |
There was a problem hiding this comment.
Should we put the value under a field in a top-level object? My reasoning is that I wouldn't be surprised that we start failing producing malformed json documents at some point, which would be the case here if you give a top-level string which is not enclosed in an object?
There was a problem hiding this comment.
Yes, I was thinking about it as well. Why the current solution is a bit faster it indeed feels somewhat hacky. I will add a top level object.
Adds support for null_value attribute to the geo_point types. Closes #12998
* master: Remove the index thread pool (#29556) Remove extra copy in ScriptDocValues.Strings Fix full cluster restart test recovery (#29545) Fix binary doc values fetching in _search (#29567) Mutes failing MovAvgIT tests Fix the assertion message for an incorrect current version. (#29572) Fix the version ID for v5.6.10. (#29570) Painless Spec Documentation Clean Up (#29441) Add versions 5.6.10 and 6.2.5 [TEST] test against scaled value instead of fixed epsilon in MovAvgIT Remove `flatSettings` support from request classes (#29560) MapperService to wrap a single DocumentMapper. (#29511) Fix dependency checks on libs when generating Eclipse configuration. (#29550) Add null_value support to geo_point type (#29451) Add documentation about the include_type_name option. (#29555) Enforce translog access via engine (#29542)
Adds support for null_value attribute to the geo_point types.
Closes #12998