GeoPoint with Spring Data ElasticSearch is giving error : QueryParsingException[field [location] is not a geo_point field]
<p>I have elasticsearch entity in spring as below : </p>

<pre><code>@Document(indexName = "cities_in", type = "cities")
public class CityDocument {

@Id
private String id;

@Field(type = FieldType.String)
private String city;

@Field(type = FieldType.Object)
@GeoPointField
private GeoPoint location;
}
</code></pre>

<p>but when I see mapping using curl <code>curl -s -XGET 'http://localhost:9200/cities_in/cities/_mapping?pretty=1'</code> I get output as:</p>

<pre><code>  {
   "cities_in" : {
   "mappings" : {
    "cities" : {
      "properties" : {
        "city" : {
          "type" : "string"
        },
        "id" : {
         "type" : "string"
      },
      "location" : {
        "properties" : {
          "geohash" : {
            "type" : "string"
          },
          "lat" : {
            "type" : "double"
          },
          "lon" : {
            "type" : "double"
          }
        }
        }
        }
     }
   }
 }
}
</code></pre>

<p>and when hit I query I get below error:</p>

<pre><code>{
 "error" : {
"root_cause" : [ {
  "type" : "query_parsing_exception",
  "reason" : "No query registered for [geo_point]",
  "index" : "cities_in",
  "line" : 1,
  "col" : 33
} ],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [ {
  "shard" : 0,
  "index" : "cities_in",
  "node" : "4jGBH3m4SkqNnBwC196hTw",
  "reason" : {
    "type" : "query_parsing_exception",
    "reason" : "No query registered for [geo_point]",
    "index" : "cities_in",
    "line" : 1,
    "col" : 33
  }
} ]
  },
  "status" : 400
 }
</code></pre>

<p>Why is location type not <code>geo_point</code>?
How to manage geopoint with spring? </p>