# Geo-point turns into text after rollover

**URL:** <https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101>\
**Category:** Elasticsearch\
**Created:** [April 8, 2020, 10:43am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101 "2020-04-08T10:43:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahmood\_Al-Imam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmood_al-imam/32/45072_2.png) [@Mahmood\_Al-Imam](https://discuss.elastic.co/u/Mahmood_Al-Imam)\
**Post date:** [April 8, 2020, 10:43am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/1 "2020-04-08T10:43:16Z")

</div>

Hi,

During my work with roll-over, I applied a policy in the ILM. This has been used with an index template. I created an index based on that template and it maps to one field type geo-point. I noticed that as soon as a roll-over take place and a new index got created, the new index has the same field as text instead of geo-point.

The following illustrates the problem:

Here is the ILM policy:

```auto
      PUT _ilm/policy/some_policy
    {
      "policy": {
        "phases": {
          "hot": {
            "actions": {
              
              "rollover": {
                   
                "max_docs": 1
                
              }
            }
          },
          "delete": {
            "min_age": "1d",
            "actions": {
              "delete": {} 
            }
          }
        }
      }
    }`

```

The template:

```auto
   PUT _template/ssl_template
    {
      "index_patterns": ["test-*"], 
      "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 1,
        "index.lifecycle.name": "some_policy", 
        "index.lifecycle.rollover_alias": "current"
      }
    }

```

Create an index based on template and map it with a field called `location` type `geo_point`

```auto
    PUT test-01
    {
      "aliases": {
        "current":{
          "is_write_index": true 
        }
      },
      "mappings" : {
        "properties": {
             "location" : {
                  "type" : "geo_point"
                }
            
          
        } 
        
      }
    }

```

I put several documents in the index using `PUT`

```auto
   PUT current/_doc/1
      {
        
            "location":"u105z"
          
      }

```

When I check the mapping of the alias `current`, I get the following:

```auto
      "test-000004" : {
        "mappings" : { }
      },
      "test-000002" : {
        "mappings" : {
          "properties" : {
            "location" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        }
      },
      "test-01" : {
        "mappings" : {
          "properties" : {
            "location" : {
              "type" : "geo_point"
            }
          }
        }
      },
      "test-000003" : {
        "mappings" : {
          "properties" : {
            "location" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        }
      }
    } 

```

As seen in response above, `test-01` is the original starting index with field 'location' as 'geo\_point', but all the subsequent indices: `test-000002`, `test-000003` have their `location` field as text.

Your advice is deeply appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [April 8, 2020, 11:03am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/2 "2020-04-08T11:03:18Z")

</div>

Hmm, an interesting problem. I can't see anything obviously wrong in your configs. Which version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 8, 2020, 11:15am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/3 "2020-04-08T11:15:08Z")

</div>

You need to create an index template that applies to all indices matching that pattern. You just applied the mapping to the first index created, which does not carry over to new indices. I would recommend including the mappings you require in the `ssl_template`.

---

<div class="post-metadata">

**Author:** ![Mahmood\_Al-Imam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmood_al-imam/32/45072_2.png) [@Mahmood\_Al-Imam](https://discuss.elastic.co/u/Mahmood_Al-Imam)\
**Post date:** [April 8, 2020, 11:16am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/4 "2020-04-08T11:16:15Z")

</div>

Hi,

My Elasticsearch is version 7.6.0

---

<div class="post-metadata">

**Author:** ![Mahmood\_Al-Imam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmood_al-imam/32/45072_2.png) [@Mahmood\_Al-Imam](https://discuss.elastic.co/u/Mahmood_Al-Imam)\
**Post date:** [April 8, 2020, 11:29am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/5 "2020-04-08T11:29:58Z")

</div>

Hi,

So, does that mean to do like that?

```auto
PUT test-01
{
  "aliases": {
    "current":{
      "is_write_index": true 
    }
  },
  "mappings" : {
    "properties": {
         "location" : {
              "type" : "geo_point"
            }
        
      
    } 
    
  }
}

```

and then re-apply the mapping to other indices

```auto
PUT test-02
{
  "aliases": {
    "current":{
      "is_write_index": true 
    }
  },
  "mappings" : {
    "properties": {
         "location" : {
              "type" : "geo_point"
            }
        
      
    } 
    
  }
}

```

```auto
PUT test-03
{
  "aliases": {
    "current":{
      "is_write_index": true 
    }
  },
  "mappings" : {
    "properties": {
         "location" : {
              "type" : "geo_point"
            }
        
      
    } 
    
  }
}

```

??

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 8, 2020, 11:34am UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/6 "2020-04-08T11:34:50Z")

</div>

No, you are still applying mapping per index. You should [use an index template to apply the correct mappings at index creation](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/indices-templates.html).

---

<div class="post-metadata">

**Author:** ![Mahmood\_Al-Imam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahmood_al-imam/32/45072_2.png) [@Mahmood\_Al-Imam](https://discuss.elastic.co/u/Mahmood_Al-Imam)\
**Post date:** [April 8, 2020, 10:18pm UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/7 "2020-04-08T22:18:45Z")

</div>

Yes, Thank you very much for the advice. It works now perfectly!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 6, 2020, 10:18pm UTC](https://discuss.elastic.co/t/geo-point-turns-into-text-after-rollover/227101/8 "2020-05-06T22:18:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
