You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried this tasks and it faild, because Mongoid::Search.classes returned [Object]. Maybe the problem is in nesting: Mongoid::Search is included into another concern, which is included to models. Any thoughts/suggestions?
The text was updated successfully, but these errors were encountered:
Mongoid::Search.classes returns Array < Object
Also you can make own rake task to loop Models.
namespace :mongoid_search do
desc 'Goes through all documents with search enabled and indexes the keywords.'
task :index => :environment do
::Rails.application.eager_load!
if Mongoid::Search.classes.blank?
Mongoid::Search::Log.log "No model to index keywords.\n"
else
Mongoid::Search.classes.each do |klass|
Mongoid::Search::Log.silent = ENV['SILENT']
Mongoid::Search::Log.log "\nIndexing documents for #{klass.name}:\n"
klass.index_keywords!
end
Mongoid::Search::Log.log "\n\nDone.\n"
end
end
end
I've tried this tasks and it faild, because
Mongoid::Search.classes
returned[Object]
. Maybe the problem is in nesting: Mongoid::Search is included into another concern, which is included to models. Any thoughts/suggestions?The text was updated successfully, but these errors were encountered: