# Geopoint requires deprecated Elasticsearch mapping types

**URL:** <https://discuss.elastic.co/t/geopoint-requires-deprecated-elasticsearch-mapping-types/219085>\
**Category:** Elasticsearch\
**Created:** [February 12, 2020, 9:37pm UTC](https://discuss.elastic.co/t/geopoint-requires-deprecated-elasticsearch-mapping-types/219085 "2020-02-12T21:37:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junebee](https://avatars.discourse-cdn.com/v4/letter/j/45deac/32.png) [@Junebee](https://discuss.elastic.co/u/Junebee)\
**Post date:** [February 12, 2020, 9:37pm UTC](https://discuss.elastic.co/t/geopoint-requires-deprecated-elasticsearch-mapping-types/219085/1 "2020-02-12T21:37:18Z")

</div>

I would like to add Geopoint data to my index.

The Elasticsearch 7.6 geoip processor states I need to add the geopoint type to my index mappings.  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-geoip.html)

This is the code for that that I've used in ES 6.5.

```
PUT _template/log_data/_mappings
    {
        "properties" : {
          "@timestamp": { "type": "date"},
          "@version": { "type": "keyword"},
    	  "src addr": {"type" : "ip"},
    	  "dest addr": {"type" : "ip"},
    	  "log_type" : {"type" : "keyword"},
          "source_geoip" : {
    	    "dynamic": true,
    	    "properties" : {
    	      "location" : { "type" : "geo_point" }, 
    	      "latitude" : { "type" : "half_float" },
              "longitude" : { "type" : "half_float" }
    		  }
    		},
          "destination_geoip" : {
    	    "dynamic": true,
    	    "properties" : {
    	      "location" : { "type" : "geo_point" }, 
    		  "latitude" : { "type" : "half_float" },
              "longitude" : { "type" : "half_float" }
    	}
          }
        }
     }

```

And yet I get this error:

```
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
  },
  "status": 400
}

```

Can someone tell me what I'm missing here?

Thanks.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [February 13, 2020, 9:49am UTC](https://discuss.elastic.co/t/geopoint-requires-deprecated-elasticsearch-mapping-types/219085/2 "2020-02-13T09:49:52Z")

</div>

You can omit the type, as Elasticsearch 7 does not make use of types anymore. Also, a workaround is mentioned in the error message.

See [https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html)

---

<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:** [March 12, 2020, 9:50am UTC](https://discuss.elastic.co/t/geopoint-requires-deprecated-elasticsearch-mapping-types/219085/3 "2020-03-12T09:50:00Z")

</div>

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