class XapianDb::IndexWriters::SidekiqWriter

Public Class Methods

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/sidekiq_writer.rb
32 def delete_doc_with(xapian_id, _commit= true)
33   Sidekiq::Client.push('queue' => queue,
34                        'class' => worker_class,
35                        'args' => ['delete_doc', { xapian_id: xapian_id }.to_json],
36                        'retry' => sidekiq_retry)
37 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/sidekiq_writer.rb
23 def index(obj, _commit= true, changed_attrs: [])
24   Sidekiq::Client.push('queue' => queue,
25                        'class' => worker_class,
26                        'args' => ['index', { class: obj.class.name, id: obj.id, changed_attrs: changed_attrs }.to_json],
27                        'retry' => sidekiq_retry)
28 end
queue() click to toggle source
   # File lib/xapian_db/index_writers/sidekiq_writer.rb
17 def queue
18   XapianDb::Config.sidekiq_queue
19 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/sidekiq_writer.rb
41 def reindex_class(klass, _options = {})
42   Sidekiq::Client.push('queue' => queue,
43                        'class' => worker_class,
44                        'args' => ['reindex_class', { class: klass.name }.to_json],
45                        'retry' => sidekiq_retry)
46 end
set_max_expansion() click to toggle source
   # File lib/xapian_db/index_writers/sidekiq_writer.rb
48 def set_max_expansion
49   XapianDb::Config.set_max_expansion
50 end
sidekiq_retry() click to toggle source
   # File lib/xapian_db/index_writers/sidekiq_writer.rb
52 def sidekiq_retry
53   XapianDb::Config.sidekiq_retry
54 end

Private Class Methods

worker_class() click to toggle source
   # File lib/xapian_db/index_writers/sidekiq_writer.rb
56 def worker_class
57   SidekiqWorker
58 end