无法创建GEO_POINT的Mapping。求指教。



 json


 {
    "testpoi": {
        "mappings": {
            "poi": {
                "properties": {
                    "address": {
                        "type": "string"
                    },
                    "location": {
                        "properties": {
                            "lat": {
                                "type": "double"
                            },
                            "lon": {
                                "type": "double"
                            }
                        }
                    },
                    "name": {
                        "type": "string"
                    }
                }
            }
        }
    }
}


 shell


 curl -XPUT 'http://localhost:9200/testpoi/_mapping/poi' -d '{"poi":{"properties":{"location":{"type":"geo_point"}}}}'
#报错:
# {"error":"MergeMappingException[Merge failed with failures {[Can't merge a non object mapping [location] with an object mapping [location]]}]","status":400}

elasticsearch

紫色Sòrγy 11 years, 2 months ago

Your Answer