# How to add new geo\_point type mapping to existing index template?

**URL:** <https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670>\
**Category:** Elasticsearch\
**Created:** [August 1, 2015, 12:04am UTC](https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670 "2015-08-01T00:04:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Joe1](https://discuss.elastic.co/u/Joe1)\
**Post date:** [August 1, 2015, 12:04am UTC](https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670/1 "2015-08-01T00:04:05Z")

</div>

We have a single index with new types constantly being created. There is a template that the index used to do the mapping. Now I would like to add a new geo\_point mapping to the template so that new types will include the new geo\_point mapping.

I tried just updating the existing template via the head plugin. It allowed me to update the template and I can see the changes when doing a GET \_template/  
eg  
"location":{"type":"geo\_point", "store":"no"}

But new types will map location to 2 float parameters.

However, if I manually create a type with a dummy document, apply the mapping to the type eg PUT /myindex/\_mapping/mynewtype -d ‘{"properties":{"location":{"type":"geo\_point","store":"no"}}}’. new documents created under mynewtype will map location as geo\_point.

So should I be updating the template? Is applying the mapping directly to a type my only option? I would like to avoid re-indexing if possible.

Thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 1, 2015, 5:19am UTC](https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670/2 "2015-08-01T05:19:22Z")

</div>

You should be updating the template, yes.

What does your entire mapping look like?

---

<div class="post-metadata">

**Author:** ![Joe1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@Joe1](https://discuss.elastic.co/u/Joe1)\
**Post date:** [August 4, 2015, 6:48pm UTC](https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670/3 "2015-08-04T18:48:28Z")

</div>

@warkolm thanks for your help. The following is the entire template / mapping we have.

```
{
  "*": {
    "order": 0,
    "template": "*",
    "settings": {
      "index.number_of_replicas": "3",
      "index.number_of_shards": "5"
    },
    "mappings": {}
  },
  "metadata": {
    "order": 1,
    "template": "metadata:*",
    "settings": {
      "index.number_of_replicas": "4",
      "index.number_of_shards": "1"
    },
    "mappings": {
      "_default_": {
        "dynamic_templates": [
          {
            "metadata": {
              "mapping": {
                "index": "no",
                "store": true,
                "type": "string"
              },
              "path_match": "*"
            }
          }
        ],
        "_all": {
          "enabled": false
        }
      }
    }
  },
  "myindex": {
    "order": 1,
    "template": "myindex*",
    "settings": {
      "index.analysis.analyzer.myindex_analyzer.tokenizer": "whitespace"
    },
    "mappings": {
      "_default_": {
        "dynamic_templates": [
          {
            "targets": {
              "index_name": "target",
              "mapping": {
                "index_name": "{name}",
                "omit_norms": "yes",
                "store": "no",
                "analyzer": "myindex_analyzer",
                "type": "string"
              },
              "match_mapping_type": "string",
              "path_match": "targets.*"
            }
          },
          {
            "metadata": {
              "mapping": {
                "index": "no",
                "store": "yes"
              },
              "path_match": "metadata.*"
            }
          }
        ],
        "properties": {
          "tags": {
            "index_name": "tag",
            "omit_norms": "yes",
            "store": "no",
            "analyzer": "myindex_analyzer",
            "type": "string"
          },
          "height": {
            "store": "yes",
            "type": "integer"
          },
          "location": {
            "store": "no",
            "type": "geo_point"
          },
          "priority": {
            "store": "yes",
            "type": "integer"
          },
          "width": {
            "store": "yes",
            "type": "integer"
          },
          "alwaysIncluded": {
            "store": "no",
            "type": "boolean"
          },
          "html": {
            "store": "yes",
            "type": "string"
          }
        },
        "_all": {
          "enabled": false
        }
      }
    }
  }
}

```

Regards,

---

<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:** [July 5, 2017, 11:57pm UTC](https://discuss.elastic.co/t/how-to-add-new-geo-point-type-mapping-to-existing-index-template/26670/4 "2017-07-05T23:57:26Z")

</div>


