class XapianDb::IndexWriters::BeanstalkWriter
Public Class Methods
Source
# File lib/xapian_db/index_writers/beanstalk_writer.rb 37 def beanstalk 38 @beanstalk ||= Beanstalk::Pool.new([XapianDb::Config.beanstalk_daemon_url]) 39 end
Source
# File lib/xapian_db/index_writers/beanstalk_writer.rb 27 def delete_doc_with(xapian_id, commit=true) 28 beanstalk.put( { :task => "delete_doc_task", :xapian_id => xapian_id }.to_json ) 29 end
Remove an object from the index @param [String] xapian_id The document id
Source
# File lib/xapian_db/index_writers/beanstalk_writer.rb 21 def index(obj, commit=true, changed_attrs: []) 22 beanstalk.put( { :task => "index_task", :class => obj.class.name, :id => obj.id, :changed_attrs => changed_attrs, :commit => commit }.to_json ) 23 end
Update an object in the index @param [Object] obj An instance of a class with a blueprint configuration
Source
# File lib/xapian_db/index_writers/beanstalk_writer.rb 33 def reindex_class(klass, options={}) 34 beanstalk.put( { :task => "reindex_class_task", :class => klass.name }.to_json ) 35 end
Reindex all objects of a given class @param [Class] klass The class to reindex