Sha256: 2b01a8363e9c6a3679c68600ab520d88c8e95fc448ecea1eb5021899d61937be

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

module Cadet
  module CadetIndex
    class IndexProvider

      def initialize(db)
        @db = db
        @indexes = {}
        @lucene_index = org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProviderNewImpl.new(db)
      end
      def nodeIndex(name, type = {"type" => "exact"})
        @indexes[name.to_sym] ||= CadetIndex::Index.new(@lucene_index, name.to_sym, type)
      end
      def shutdown
        @indexes.each do |name, index|
          index.flush
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cadet-0.0.9-java lib/cadet/cadet_index/index_provider.rb
cadet-0.0.8-java lib/cadet/cadet_index/index_provider.rb