创建模型后,searchkick 会自动更新索引吗?

Does searchkick automatically update the index after model has been created?

当我像这样在 AR 模型中包含 searchkick 时:

class Dog < ActiveRecord::Base
  searchkick # callbacks: :async
end

当我创建一个新的 Dog 模型时,索引是自动同步的,还是我必须实现这是一个 after_commit 回调?我发现文档在这一点上有些含糊不清,我无法在测试中验证此行为。

他们应该自动重建索引。除非你有东西挡住他们。

By default, all records are indexed. To control which records are indexed, use the should_index? method together with the search_import scope.

https://github.com/ankane/searchkick#indexing