0

Ad モデルに次の属性があります。

has sort_by_date, :as => :timestamp, :sortable => true

ads テーブルには、日時フィールドである sort_by_date フィールドがあります。

ただし、検索するときは、次を :order オプションとして渡します (新しい広告を最初に表示してから、関連性で並べ替えたい)

:order => "sort_by_date DESC, @weight DESC"

次のエラーが表示されます。

ThinkingSphinx::SphinxError (index ad_core: sort-by attribute 'sort_by_date' not found):

なぜこれが起こっているのか誰にもわかりますか?

ありがとう!

4

1 に答える 1

0

Ok, so I got this working by changing my sort_by_date field in the database from a datetime to a timestamp, hope this helps someone else out.

于 2013-04-27T19:56:03.803 に答える