# Nest elasticsearch 7 Geolocation indexing

**URL:** <https://discuss.elastic.co/t/nest-elasticsearch-7-geolocation-indexing/184307>\
**Category:** Elasticsearch\
**Created:** [June 5, 2019, 8:32am UTC](https://discuss.elastic.co/t/nest-elasticsearch-7-geolocation-indexing/184307 "2019-06-05T08:32:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [June 10, 2019, 8:05am UTC](https://discuss.elastic.co/t/nest-elasticsearch-7-geolocation-indexing/184307/2 "2019-06-10T08:05:14Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

* * *

It looks like you're using NEST 7.x, based on the create index API call. I can't replicate what you're seeing with NEST 7.0.0-alpha2

```auto
private static void Main()
{
    var defaultIndex = "example_index";
    var pool = new SingleNodeConnectionPool(new Uri("http://localhost:9200"));

    var settings = new ConnectionSettings(pool)
        .DefaultIndex(defaultIndex);

    var client = new ElasticClient(settings);

    var createIndexResponse = client.CreateIndex("honadona", c => c
        .Map<ElasticSearchModel>(mm => mm
            .AutoMap()
        )
    );
}

public class ElasticSearchModel
{
	public GeoLocation Location { get; set; }
	public int Id { get; set; }
	public string BuildTitle { get; set; }
	public DateTime CreatedDate { get; set; }
	public int TotalRooms { get; set; }
	public string Description { get; set; }
	public decimal? OwnerPrice { get; set; }
	public double? Size { get; set; }
	public string SizeName { get; set; }
	public string MoneyType { get; set; }
	public string BuildAction { get; set; }
}

```

produces the following request

```json
PUT http://localhost:9200/honadona?pretty=true 
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      },
      "id": {
        "type": "integer"
      },
      "buildTitle": {
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        },
        "type": "text"
      },
      "createdDate": {
        "type": "date"
      },
      "totalRooms": {
        "type": "integer"
      },
      "description": {
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        },
        "type": "text"
      },
      "ownerPrice": {
        "type": "double"
      },
      "size": {
        "type": "double"
      },
      "sizeName": {
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        },
        "type": "text"
      },
      "moneyType": {
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        },
        "type": "text"
      },
      "buildAction": {
        "fields": {
          "keyword": {
            "ignore_above": 256,
            "type": "keyword"
          }
        },
        "type": "text"
      }
    }
  }
}

```

where `location` is `geo_point`. In your case, it sounds like the index may have already been created before this API call was made, possibly as a result of indexing a document before the explicit mapping for `location` was created. In this case, a mapping cannot be updated to be changed from one field datatype to another.

To resolve, you would need to delete the index and create it again, using a create index API call like above.

---

_[View the full topic](https://discuss.elastic.co/t/nest-elasticsearch-7-geolocation-indexing/184307)._
