gpt4 book ai didi

ElasticSearch QueryParsingException 找不到 geo_point 字段

转载 作者:行者123 更新时间:2023-11-29 02:48:06 25 4
gpt4 key购买 nike

尝试按如下方式构建搜索:

{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"distance": "50km",
"coordinates": {
"lat": 52.5234051,
"lon": 4.113999
}
}
}
}
}
}

其中坐标的类型是'geo_point'

但是当我尝试运行这个查询时,elasticsearch.log 弹出一个错误:[locations] 找不到 geo_point 字段 [coordinates]

编辑:

这是/locations/location/_mapping 的一部分:

{
"locations": {
"mappings": {
"location": {
"properties": {
...
"coordinates": {
"properties": {
"lat": {
"type": "string"
},
"lon": {
"type": "string"
}
}
},
...
}
}

知道这里出了什么问题吗?

最佳答案

问题是映射。您需要在映射中使用 geo_point.. refer this .

关于ElasticSearch QueryParsingException 找不到 geo_point 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23612193/

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