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

Docs out of sync regarding default values for geo_shape mapping #23206

Closed
adambro opened this issue Feb 16, 2017 · 4 comments
Closed

Docs out of sync regarding default values for geo_shape mapping #23206

adambro opened this issue Feb 16, 2017 · 4 comments
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes good first issue low hanging fruit

Comments

@adambro
Copy link

adambro commented Feb 16, 2017

Elasticsearch version: number": "5.1.1", "build_hash": "5395e21" from official Docker image

Description of the problem including expected versus actual behavior:

When I query the default mapping values using mapping API with ?include_defaults=true I'm getting the following for geo_shape field:

{
              "type": "geo_shape",
              "tree": "geohash",
              "tree_levels": 0,
              "precision": "-1.0m",
              "strategy": "recursive",
              "distance_error_pct": 0.025,
              "orientation": "RIGHT",
              "points_only": false,
              "coerce": false
 }

Above values do not match the default values mentioned in documentation:
https://www.elastic.co/guide/en/elasticsearch/reference/5.1/geo-shape.html#geo-shape-mapping-options

Here's the query result when I've added precision: 1m property to geo_shape mapping:

{
              "type": "geo_shape",
              "tree": "geohash",
              "tree_levels": 0,
              "precision": "1.0m",
              "strategy": "recursive",
              "distance_error_pct": 0.0,
              "orientation": "RIGHT",
              "points_only": false,
              "coerce": false
}

Still tree_levels is 0 (which is confusing). On the other hand distance_error_pct changes to 0 as documented.

Not sure if it's only docs out o date, because:

  • tree_levels: 0 seems to be a bug
  • precision: "-1.0m" by default does not make sense
@clintongormley clintongormley added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Feb 16, 2017
@clintongormley
Copy link

@nknize could you have a look please?

@adambro
Copy link
Author

adambro commented May 12, 2017

Hi @clintongormley and @nknize any news on geo search docs being out of date?

@nknize nknize added the good first issue low hanging fruit label Mar 26, 2018
@imotov imotov assigned imotov and unassigned nknize Jun 12, 2018
@imotov
Copy link
Contributor

imotov commented Jun 12, 2018

The problem here is not that the docs are out of sync, but that we are showing placeholder values instead of default values in the mapping with ?include_defaults=true. Placeholder values are not the actual values that are used, but instead they indicate that the value wasn't specified and we should use defaults instead. The result might be confusing. For example the placeholder value of -1 for precision indicates that the default value of 50m should be used.

imotov added a commit to imotov/elasticsearch that referenced this issue Jun 13, 2018
GeoShapeFieldMapper should show actual defaults instead of placeholder
values when the mapping is requested with include_defaults=true.

Closes elastic#23206
@adambro
Copy link
Author

adambro commented Jun 14, 2018

@imotov thanks for handling this!

imotov added a commit that referenced this issue Jun 18, 2018
GeoShapeFieldMapper should show actual defaults instead of placeholder
values when the mapping is requested with include_defaults=true.

Closes #23206
imotov added a commit that referenced this issue Jun 19, 2018
GeoShapeFieldMapper should show actual defaults instead of placeholder
values when the mapping is requested with include_defaults=true.

Closes #23206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes good first issue low hanging fruit
Projects
None yet
Development

No branches or pull requests

4 participants