sql_attr_multi中预期的attr类型('uint'或'timestamp'或'bigint')

时间:2013-11-21 17:01:43

标签: mysql ruby-on-rails thinking-sphinx

我正在尝试重新思考思考狮身人面像,我仍然坚持这个错误:source 'user_core_0': expected attr type ('uint' or 'timestamp' or 'bigint') in sql_attr_multi, got 'string zip_city from field'

我不确定还有什么需要改变。

ThinkingSphinx::Index.define :user, :with => :active_record do
  # fields
  indexes name, :as => :user, :sortable => true
  indexes religion, zip_code, about_me, career, sexuality, children, user_smoke, user_drink, gender, ethnicity, education


  # attributes
  has id, created_at, updated_at
  has zips.city, :as => :zip_city

  has "RADIANS(zips.lat)",  :as => :latitude,  :type => :float
  has "RADIANS(zips.lon)", :as => :longitude, :type => :float


end

1 个答案:

答案 0 :(得分:1)

尝试更改属性

has zips.city, :as => :zip_city

  has "(ZIP)zip.city", :as => :zip_city, :type => :integer