整个对象为“ geo_point”

时间:2018-08-03 18:41:17

标签: elasticsearch

我已将文档的属性声明为“嵌套”。在这种情况下为“位置”。该对象是否可能具有'geo_point'数据类型并具有其他信息,例如'id'。

类似这样的东西:

"user": {
    "locations": [
        {
            "id": 5,
            "location": "40, 50"
        }
    ]
}

是否可以更改“位置”的名称?我想要“ number_latitude”和“ number_longitude”,但我需要将其作为“ geo_point”。

1 个答案:

答案 0 :(得分:0)

尝试扩展映射

curl -XPUT 'http://localhost:9200/auuser1/user1/_mapping' -d '{
"user": {
    "locations": [
        {
            "id": 5,
            "location": "40, 50"

        }
    "locations_ext": [
        {
            "id": 5,
            "location": "40, 50"
            "number_latitude": "40.00"
            "number_longitude": "-50.00"
        }
    ]
}
}'

Extend Mapping