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


19
20
21
22
23
24
25
# File 'lib/elasticsearch/model/importing.rb', line 19

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