You'll need to delete the existing index if there is one and create again
public class Message
{
public GeoLocation Location { get; set; }
}
var defaultIndex = "messages";
var client = new ElasticClient();
if (client.IndexExists(defaultIndex).Exists)
{
client.DeleteIndex(defaultIndex);
}
client.CreateIndex(defaultIndex, c=> c
.Mappings(m => m
.Map<Message>(mm => mm
.AutoMap()
)
)
);
yields
PUT http://localhost:9200/messages
{
"mappings": {
"message": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}