【发布时间】:2020-07-18 12:02:08
【问题描述】:
§大家好,
我对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 位置,位置属于_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]"}}
为什么?
谢谢
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-6 chewy-gem