Class: XapianDb::IndexWriters::ResqueWriter
- Inherits:
-
Object
- Object
- XapianDb::IndexWriters::ResqueWriter
- Defined in:
- lib/xapian_db/index_writers/resque_writer.rb
Class Method Summary collapse
-
.delete_doc_with(xapian_id, commit = true) ⇒ Object
Remove an object from the index.
-
.index(obj, commit = true, changed_attrs: []) ⇒ Object
Update an object in the index.
-
.reindex_class(klass, options = {}) ⇒ Object
Reindex all objects of a given class.
- .worker_class ⇒ Object
Class Method Details
.delete_doc_with(xapian_id, commit = true) ⇒ Object
Remove an object from the index
21 22 23 |
# File 'lib/xapian_db/index_writers/resque_writer.rb', line 21 def delete_doc_with(xapian_id, commit=true) Resque.enqueue worker_class, :delete_doc, :xapian_id => xapian_id end |
.index(obj, commit = true, changed_attrs: []) ⇒ Object
Update an object in the index
15 16 17 |
# File 'lib/xapian_db/index_writers/resque_writer.rb', line 15 def index(obj, commit=true, changed_attrs: []) Resque.enqueue worker_class, :index, :class => obj.class.name, :id => obj.id, changed_attrs: changed_attrs end |
.reindex_class(klass, options = {}) ⇒ Object
Reindex all objects of a given class
27 28 29 |
# File 'lib/xapian_db/index_writers/resque_writer.rb', line 27 def reindex_class(klass, = {}) Resque.enqueue worker_class, :reindex_class, :class => klass.name end |
.worker_class ⇒ Object
31 32 33 |
# File 'lib/xapian_db/index_writers/resque_writer.rb', line 31 def worker_class ResqueWorker end |