Class: EsMigrationDsl

Inherits:
Wukong::Migration::Dsl show all
Includes:
EsHttpOperation::Helpers
Defined in:
lib/wukong-migrate/elasticsearch_migration.rb

Direct Known Subclasses

EsMigration, IndexDsl, ObjectDsl

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EsHttpOperation::Helpers

#alias_index_op, #create_index_op, #delete_index_op, #update_mapping_op, #update_settings_op

Methods inherited from Wukong::Migration::Dsl

define, perform

Methods included from Gorillib::Builder

#getset, #getset_collection_item

Class Method Details

.template(name) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 4

def self.template name
  <<-TEMPLATE.gsub(/^ {6}/, '').strip
    EsMigration.define '#{name}' do
      # Use dsl methods to: 
      # * create/update/delete indices
      # * update index settings
      # * add/remove aliases
      # * create/update/delete mappings using models defined in app/models
      #
      # create_index(:index_name) do
      #   number_of_replicas 5
      #   alias_to [:alias_one, :alias_two]
      #   create_mapping(:model_name) do
      #     dynamic true
      #     ttl     true
      #   end
      # end
    end
  TEMPLATE
end

Instance Method Details

#operation_listObject



25
26
27
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 25

def operation_list
  @operation_list ||= []
end