我在春季有弹性搜索实体,如下所示:
@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;
}
Run Code Online (Sandbox Code Playgroud)
但是当我使用 curl 看到映射时,我curl -s -XGET 'http://localhost:9200/cities_in/cities/_mapping?pretty=1'得到的输出为:
{
"cities_in" : {
"mappings" : {
"cities" : {
"properties" : {
"city" : {
"type" : "string"
},
"id" : {
"type" : "string"
},
"location" : {
"properties" : {
"geohash" : {
"type" : "string"
},
"lat" : { …Run Code Online (Sandbox Code Playgroud)