-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
Description
Calling index!
in a model that uses STI creates a separate index with that model's name as its name.
Steps to reproduce
My current setup has a parent model with a few sub-classes:
class Content < ActiveRecord::Base
include AlgoliaSearch
algoliasearch { ... }
end
class Post < Content
end
When calling Content.find(id).index!
or Post.find(id).index!
the current implementation creates a new index named Post
instead of reusing the parent index Content
. I've fixed this by specifying the index name:
class Content < ActiveRecord::Base
include AlgoliaSearch
algoliasearch index_name: "Content" { ... }
end
I'm also aware I can do Content.where(id: id).reindex!
and this will work.
If this is expected behavior then would it be worth mentioning it in the docs?
Metadata
Metadata
Assignees
Labels
No labels