版本: 6.8-8.9
简而言之,当 geo-point 字段中提供的坐标格式不正确时,就会发生此错误。Elasticsearch 要求坐标以数组或字符串的形式指定,而不是以对象的形式。要解决此问题,您可以提供 “lat,lon” 格式的字符串坐标,或者 [lon,lat] 格式的数组坐标。请确保在数组格式中,经度在前。同时,请检查您的映射,确保该字段已正确设置为 geo-point 类型。
日志上下文 #
日志 “coordinates cannot be specified as objects” 类名是 GeoJsonParser.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
*/
private static CoordinateNode parseCoordinates(XContentParser parser; boolean ignoreZValue) throws IOException {
if (parser.currentToken() == XContentParser.Token.START_OBJECT) {
parser.skipChildren();
parser.nextToken();
throw new ElasticsearchParseException("coordinates cannot be specified as objects");
} XContentParser.Token token = parser.nextToken();
// Base cases
if (token != XContentParser.Token.START_ARRAY





