Class: ElasticRecord::Index

Inherits:
Object
  • Object
show all
Includes:
Documents, Manage, Mapping, Percolator
Defined in:
lib/elastic_record/index.rb,
lib/elastic_record/index/manage.rb,
lib/elastic_record/index/mapping.rb,
lib/elastic_record/index/documents.rb,
lib/elastic_record/index/percolator.rb

Defined Under Namespace

Modules: Documents, Manage, Mapping, Percolator

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Percolator

#create_percolator, #delete_percolator, #percolate, #percolator_exists?, #percolator_index_name, #reset_percolator

Methods included from Mapping

#mapping, #mapping=

Methods included from Manage

#aliased_names, #all_names, #create, #create_and_deploy, #delete, #delete_all, #deploy, #exists?, #refresh, #reset, #update_mapping

Methods included from Documents

#bulk, #bulk_add, #delete_document, #explain, #index_document, #record_exists?, #scroll, #search

Constructor Details

#initialize(model) ⇒ Index

Returns a new instance of Index.



17
18
19
20
# File 'lib/elastic_record/index.rb', line 17

def initialize(model)
  @model = model
  @disabled = false
end

Instance Attribute Details

#disabledObject

Returns the value of attribute disabled.



15
16
17
# File 'lib/elastic_record/index.rb', line 15

def disabled
  @disabled
end

#modelObject

Returns the value of attribute model.



14
15
16
# File 'lib/elastic_record/index.rb', line 14

def model
  @model
end

Instance Method Details

#alias_nameObject



22
23
24
# File 'lib/elastic_record/index.rb', line 22

def alias_name
  @alias_name ||= model.base_class.model_name.collection
end

#disable!Object



30
31
32
# File 'lib/elastic_record/index.rb', line 30

def disable!
  @disabled = true
end

#enable!Object



34
35
36
# File 'lib/elastic_record/index.rb', line 34

def enable!
  @disabled = false
end

#typeObject



26
27
28
# File 'lib/elastic_record/index.rb', line 26

def type
  @type ||= model.base_class.model_name.element
end