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

Can’t change settings for an index with a geo_shape field using term strategy #31707

Closed
tristanbuckner opened this issue Jun 30, 2018 · 4 comments
Assignees
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@tristanbuckner
Copy link

Elasticsearch version: 6.3.0

Plugins installed: Vanilla found.io installation

JVM version: Vanilla found.io installation

OS version: Vanilla found.io options

Description of the problem including expected versus actual behavior:
When creating an index with a field of type geo_shape that uses the term strategy, I've observed some strange behaviors (this is in hosted 6.3.0).

Creating an index with a geoshape field set to term strategy takes just over 30 seconds (feeling very much like a timeout), but does ultimately report success. However, if you subsequently try to change any settings, you get a mapper parsing error about the original supposedly successfully created mapping having an unsupported points_only field (whether or not not you explicitly specified it, or just got it from using the term strategy).

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. Create mapping
PUT /example
{
  "mappings": {
    "doc": {
      "properties": {
        "location": {
          "type": "geo_shape",
          "tree": "quadtree",
          "precision": "10m",
          "strategy": "term"
        }
      }
    }
  }
}
  1. Change a setting
PUT /example/_settings
{
"settings": {"refresh_interval": "-1"} 
}

Response

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Mapping definition for [location] has unsupported parameters:  [points_only : true]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Failed to parse mapping [doc]: Mapping definition for [location] has unsupported parameters:  [points_only : true]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Mapping definition for [location] has unsupported parameters:  [points_only : true]"
    }
  },
  "status": 400
}
@tlrx tlrx added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jul 2, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@imotov imotov self-assigned this Jul 2, 2018
@imotov
Copy link
Contributor

imotov commented Jul 2, 2018

@tristanbuckner could you run the following command to see if this index got any shards assigned?

GET /_cat/shards/example

@tristanbuckner
Copy link
Author

@imotov Looks like they didn't.

example 4 p UNASSIGNED    
example 4 r UNASSIGNED    
example 3 p UNASSIGNED    
example 3 r UNASSIGNED    
example 1 p UNASSIGNED    
example 1 r UNASSIGNED    
example 2 p UNASSIGNED    
example 2 r UNASSIGNED    
example 0 p UNASSIGNED    
example 0 r UNASSIGNED

@imotov
Copy link
Contributor

imotov commented Jul 2, 2018

OK, that makes sense then. I am going to open PR with a fix in a bit. Unfortunately, I cannot think of any workaround at the moment besides not using "strategy": "term" until the issue is fixed. Sorry about that.

imotov added a commit to imotov/elasticsearch that referenced this issue Jul 3, 2018
Fixes 2 issues that together cause errors during index creation
with geo_shapes that use the term strategy. The term strategy changes
the default for points_only parameter, but this wasn't taken into
account during serialization. So, setting the term strategy would add
`"points_only": true` to serialization. At the same time if the term
strategy would also cause the `points_only` setting to be not marked as
a processed element during parsing, which would cause index creation to
fail with the error: `Mapping definition for [location] has unsupported
parameters:  [points_only : true]`.

Fixes elastic#31707
imotov added a commit that referenced this issue Jul 5, 2018
Fixes 2 issues that together cause errors during index creation
with geo_shapes that use the term strategy. The term strategy changes
the default for points_only parameter, but this wasn't taken into
account during serialization. So, setting the term strategy would add
`"points_only": true` to serialization. At the same time if the term
strategy would also cause the `points_only` setting to be not marked as
a processed element during parsing, which would cause index creation to
fail with the error: `Mapping definition for [location] has unsupported`
`parameters:  [points_only : true]`.

Fixes #31707
imotov added a commit that referenced this issue Jul 5, 2018
Fixes 2 issues that together cause errors during index creation
with geo_shapes that use the term strategy. The term strategy changes
the default for points_only parameter, but this wasn't taken into
account during serialization. So, setting the term strategy would add
`"points_only": true` to serialization. At the same time if the term
strategy would also cause the `points_only` setting to be not marked as
a processed element during parsing, which would cause index creation to
fail with the error: `Mapping definition for [location] has unsupported`
`parameters:  [points_only : true]`.

Fixes #31707
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants