§嗨伙计们,我对geo_point
类型定义有疑问
我的耐嚼指数代码:
class CoordinatesIndex < Chewy::Index
define_type Coordinate.includes( :location ) do
field :location, type: 'geo_point'
field :user_id, type: 'integer'
field :start_at
field :finish_at
field :created_at
end
end
我也有关系坐标has_one位置,位置belongs_to坐标。
位置模型字段:
lat
,lon
我得到的错误:
{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [location] of type [geo_point]", "caused_by"=>{"type"=>"parse_exception", "reason"=>"field must be either [lat], [lon] or [geohash]"}}
为什么?
谢谢