# Can't use geo\_shape index, elastic 2.1

**URL:** <https://discuss.elastic.co/t/cant-use-geo-shape-index-elastic-2-1/46903>\
**Category:** Elasticsearch\
**Created:** [April 10, 2016, 4:54pm UTC](https://discuss.elastic.co/t/cant-use-geo-shape-index-elastic-2-1/46903 "2016-04-10T16:54:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Chambers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_chambers/32/607_2.png) [@Matt\_Chambers](https://discuss.elastic.co/u/Matt_Chambers)\
**Post date:** [April 10, 2016, 4:54pm UTC](https://discuss.elastic.co/t/cant-use-geo-shape-index-elastic-2-1/46903/1 "2016-04-10T16:54:41Z")

</div>

Not sure what is going on, I'm putting the data in the exact format the docs are asking for.

Mapping:  
"properties": {  
"annotations": {  
"type": "geo\_shape"  
}  
}

Data:  
"annotations": {"type":"point","coordinates":[1.0,1.0]}

I get:  
MapperParsingException[failed to parse [annotations]  
]; nested: ElasticsearchParseException[shape must be an object consisting of type and coordinates];

When I look at the code throwing that exception, its failing to recognize the data as an object, but it clearly is an object

```
    public static ShapeBuilder parse(XContentParser parser, GeoShapeFieldMapper shapeMapper) throws IOException {
        if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
            return null;
        } else if (parser.currentToken() != XContentParser.Token.START_OBJECT) {
            throw new ElasticsearchParseException("shape must be an object consisting of type and coordinates");
        }
```

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [April 12, 2016, 8:08am UTC](https://discuss.elastic.co/t/cant-use-geo-shape-index-elastic-2-1/46903/2 "2016-04-12T08:08:26Z")

</div>

Hi Matt,

there must be a minor error in your mapping or in how you insert the document. Here is an example (tested with Elasticsearch 2.3):

create index:

```auto
POST /geo
{
   "mappings": {
      "type": {
         "properties": {
            "annotations": {
               "type": "geo_shape"
            }
         }
      }
   }
}

```

Add a document:

```auto
PUT /geo/type/1
{
   "annotations": {
      "type": "point",
      "coordinates": [1, 1]
   }
}

```

Retrieve it again with `GET /geo/type/1`:

Response:

```auto
{
   "_index": "geo",
   "_type": "type",
   "_id": "1",
   "_version": 1,
   "found": true,
   "_source": {
      "annotations": {
         "type": "point",
         "coordinates": [
            1,
            1
         ]
      }
   }
}

```

I hope this helps.

Daniel

---

<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:00pm UTC](https://discuss.elastic.co/t/cant-use-geo-shape-index-elastic-2-1/46903/3 "2017-07-05T23:00:22Z")

</div>


