Module: Elasticsearch::Model::Importing

Defined in:
lib/elasticsearch/model/importing.rb

Overview

Provides support for easily and efficiently importing large amounts of records from the including class into the index.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

When included in a model, adds the importing methods.

Examples:

Import all records from the ‘Article` model


Article.import

See Also:

  • #import


36
37
38
39
40
41
42
# File 'lib/elasticsearch/model/importing.rb', line 36

def self.included(base)
  base.__send__ :extend, ClassMethods

  adapter = Adapter.from_class(base)
  base.__send__ :include, adapter.importing_mixin
  base.__send__ :extend,  adapter.importing_mixin
end