Class: Cadet::CadetIndex::IndexProvider
- Inherits:
-
Object
- Object
- Cadet::CadetIndex::IndexProvider
- Defined in:
- lib/cadet/cadet_index/index_provider.rb
Instance Method Summary collapse
-
#initialize(db) ⇒ IndexProvider
constructor
A new instance of IndexProvider.
- #nodeIndex(name, type) ⇒ Object
- #shutdown ⇒ Object
Constructor Details
#initialize(db) ⇒ IndexProvider
Returns a new instance of IndexProvider.
5 6 7 8 9 |
# File 'lib/cadet/cadet_index/index_provider.rb', line 5 def initialize(db) @db = db @indexes = {} @lucene_index = LuceneBatchInserterIndexProviderNewImpl.new(db) end |
Instance Method Details
#nodeIndex(name, type) ⇒ Object
10 11 12 |
# File 'lib/cadet/cadet_index/index_provider.rb', line 10 def nodeIndex(name, type) @indexes[name] ||= Cadet::CadetIndex::Index.new(@lucene_index, name, type) end |
#shutdown ⇒ Object
13 14 15 16 17 |
# File 'lib/cadet/cadet_index/index_provider.rb', line 13 def shutdown @indexes.each do |name, index| index.flush end end |