Class: ThinkingSphinx::Deletion

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/deletion.rb

Direct Known Subclasses

PlainDeletion, RealtimeDeletion

Defined Under Namespace

Classes: PlainDeletion, RealtimeDeletion

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, ids) ⇒ Deletion

Returns a new instance of Deletion



15
16
17
# File 'lib/thinking_sphinx/deletion.rb', line 15

def initialize(index, ids)
  @index, @ids = index, Array(ids)
end

Class Method Details

.perform(index, ids) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/thinking_sphinx/deletion.rb', line 4

def self.perform(index, ids)
  return if index.distributed?

  {
    'plain' => PlainDeletion,
    'rt'    => RealtimeDeletion
  }[index.type].new(index, ids).perform
rescue ThinkingSphinx::ConnectionError => error
  # This isn't vital, so don't raise the error.
end