class XapianDb::IndexWriters::BeanstalkWriter

Public Class Methods

beanstalk() click to toggle 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
delete_doc_with(xapian_id, commit=true) click to toggle source

Remove an object from the index @param [String] xapian_id The document id

   # 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
index(obj, commit=true, changed_attrs: []) click to toggle source

Update an object in the index @param [Object] obj An instance of a class with a blueprint configuration

   # 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
reindex_class(klass, options={}) click to toggle source

Reindex all objects of a given class @param [Class] klass The class to reindex

   # 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