疲劳是最舒适的枕头,努力工作吧。

elasticsearch 创建地图坐标索引问题

匿名 | 发布于2019年12月09日 | 阅读数:1358

curl -X PUT 'localhost:9200/shops'  -d '{"mappings":{"_doc":{"properties":{"name":{"type":"text"},"location":{"type":"geo_point", "fielddata":{"format":"compressed","precision ":"1km"}},"total_type":{"type":"integer"},"total_id":{"type":"integer"},"other_info":{"type":"text"}}}}}' -H 'Content-type:application/json'
 
报错:{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Mapping definition for [location] has unsupported parameters:  [fielddata : {precision=1km, format=compressed}]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [_doc]: Mapping definition for [location] has unsupported parameters:  [fielddata : {precision=1km, format=compressed}]","caused_by":{"type":"mapper_parsing_exception","reason":"Mapping definition for [location] has unsupported parameters:  [fielddata : {precision=1km, format=compressed}]"}},"status":400}

疑问: "fielddata":{"format":"compressed","precision":"1km"} 这个字段不是可以用吗?
已邀请:

liuxg - Elastic

赞同来自:

如果你看一下fielddata的这个字段的介绍,应该是true和false。 ​https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册