gpt4 book ai didi

elasticsearch - 如何自动将位置映射到geo_point? Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 22:52:40 25 4
gpt4 key购买 nike

我想知道如何将每个称为"location"的字段设置为"geo_point"类型。

我可以为此使用默认映射吗?如果是,我找不到任何示例。

还是应该使用动态模板?

谢谢

最佳答案

您可以使用动态模板。这是创建索引时如何执行此操作的示例:

 curl -XPOST localhost:9200/test -d '{
"settings": {
"number_of_shards": 1
},
"mappings": {
"_default_:": {
"_ttl": true,
"dynamic_templates": [
{
"geo_location": {
"mapping": {
"type": "geo_point"
},
"match": "location"
}
}
]
}
}
}'

关于elasticsearch - 如何自动将位置映射到geo_point? Elasticsearch ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16151646/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com