I’m having some problems with getting the drb server to work correctly
on my production server. As a workaround I tried disabling automatic
indexing and have a cron job manually update the index every hour or so.
I disabled the automatic indexing with:
def ferret_enabled?
false
end
But whenever I try Page.rebuild_index
I get a ‘wrong number of arguments’ error. I seem to remember that
this used to work, am I doing something wrong or has something changed?
The full error:
ArgumentError: wrong number of arguments (1 for 0)
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/bulk_indexer.rb:19:in ferret_enabled?' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/bulk_indexer.rb:19:inindex_records’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/bulk_indexer.rb:19:in each' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/bulk_indexer.rb:19:inindex_records’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/bulk_indexer.rb:29:in measure_time' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/bulk_indexer.rb:18:inindex_records’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/ferret_extensions.rb:52:in index_model' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/class_methods.rb:66:inrecords_for_rebuild’
from ./script/…/config/…/config/…/vendor/rails/activerecord/lib/
active_record/connection_adapters/abstract/database_statements.rb:
59:in transaction' from ./script/../config/../config/../vendor/rails/activerecord/lib/ active_record/transactions.rb:95:intransaction’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/class_methods.rb:61:in records_for_rebuild' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/ferret_extensions.rb:51:inindex_model’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/ferret_extensions.rb:39:in index_models' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/ferret_extensions.rb:39:ineach’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/ferret_extensions.rb:39:in index_models' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/ lib/local_index.rb:60:inrebuild_index’
from ./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/
lib/class_methods.rb:33:in `rebuild_index’
On Thu, Jan 10, 2008 at 04:19:02PM +0100, jeroen janssen wrote:
But whenever I try Page.rebuild_index
I get a ‘wrong number of arguments’ error. I seem to remember that
this used to work, am I doing something wrong or has something changed?
ferret_enabled? takes a boolean argument telling it if there’s a bulk
indexing going on, or if it’s a normal update of a single record. So
in your case, overriding it like that:
def ferret_enabled?(is_bulk_index)
is_bulk_index
end
should do what you want - disable normal index updates, but allow them
during rebuild and bulk_index calls…