class XapianDb::IndexWriters::BeanstalkWorker
Worker to update the Xapian index; the worker is used in the beanstalk worker script and uses the DirectWriter
to do the real work @author Gernot Kogler
Public Instance Methods
delete_doc_task(options)
click to toggle source
# File lib/xapian_db/index_writers/beanstalk_worker.rb 19 def delete_doc_task(options) 20 DirectWriter.delete_doc_with options[:xapian_id] 21 end
index_task(options)
click to toggle source
# File lib/xapian_db/index_writers/beanstalk_worker.rb 13 def index_task(options) 14 klass = constantize options[:class] 15 obj = klass.respond_to?(:get) ? klass.get(options[:id]) : klass.find(options[:id]) 16 DirectWriter.index obj, options[:commit], changed_attrs: options[:changed_attrs] 17 end
reindex_class_task(options)
click to toggle source
# File lib/xapian_db/index_writers/beanstalk_worker.rb 23 def reindex_class_task(options) 24 klass = constantize options[:class] 25 DirectWriter.reindex_class klass, :verbose => false 26 end