If this is my model is the portion after_destroy() {tire.index.delete}
the right way to use a callback to delete the index (which is out of sync with the db)?
If not how and where can I manually delete the index without using curl?
class Tag < ActiveRecord::Base
attr_accessible :name
include Tire::Model::Search
include Tire::Model::Callbacks
after_destroy() {tire.index.delete}
def self.search(params)
tire.search(load: true) do
query { string params[:query]} if params[:query].present?
end
end
end
You can start the ruby console where your code exists and run this there.
The index name for a model based tire approach takes plural form of model name as index name. eg: article.rb takes articles as index name.
In your case it would be
Do note you can also use wildcards in the index name
will delete any index which has index name that ends with "articles"