多重索引地理位置的ES问题

时间:2018-10-28 13:32:38

标签: php elasticsearch elasticsearch-6

我正在使用ElasticSearch PHP,并将文档中建议的映射位置作为地理位置

'location' => [
            'type' => 'geo_point'
        ]

由于我需要多个值,因此我查询将它们索引到文档中

select CONCAT('[', (select GROUP_CONCAT(CONCAT('[', CONCAT(city.latitude,',',city.longitude), ']'))
                                from city, city_xref
                                where city_xref.city_id = city.id), ']') as location from search_table;

运行查询时,我可以在查询浏览器中看到如下结果

[[37.77993,-121.97802],[37.77993,-121.97802]]

尝试了几种其他方式

[{37.77993,-121.97802},{37.77993,-121.97802}]

另一种方式

{{37.77993,-121.97802},{37.77993,-121.97802}}

但是它给出了这样的错误

mapper_parsing_exception"
reason  "failed to parse"
caused_by   
type    "number_format_exception"
reason  "For input string: \"[{lat: 37.77993\""

即使我尝试使用单一经度和纬度进行映射,其余所有其他事物仍按预期工作。

请帮我解决我做错的地方。

0 个答案:

没有答案