1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Sunspot/Solr インデックス更新をアトリビュート指定して除外する

Posted at
user.rb
class User < ActiveRecord::Base
  # last_sign_in_at, current_sign_in_at, sign_in_count, updated_at が変更されてもインデックスを更新しない
  searchable :ignore_attribute_changes_of => [:last_sign_in_at, :current_sign_in_at, :sign_in_count, :updated_at] do
    text :username
    text :bio
    time :created_at
  end
end
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?