module Elasticsearch::Model::Naming::InstanceMethods

Public Instance Methods

document_type(name=nil) click to toggle source

@example Set the document type for an instance of the ‘Article` model

@article.document_type "my-article"
@article.__elasticsearch__.update_document
# File lib/elasticsearch/model/naming.rb, line 86
def document_type name=nil
  @document_type = name || @document_type || self.class.document_type
end
document_type=(name) click to toggle source

Set the document type

@see document_type

# File lib/elasticsearch/model/naming.rb, line 94
def document_type=(name)
  @document_type = name
end
index_name(name=nil) click to toggle source

Get or set the index name for the model instance

@example Set the index name for an instance of the ‘Article` model

@article.index_name "articles-#{@article.user_id}"
@article.__elasticsearch__.update_document
# File lib/elasticsearch/model/naming.rb, line 70
def index_name name=nil
  @index_name = name || @index_name || self.class.index_name
end
index_name=(name) click to toggle source

Set the index name

@see index_name

# File lib/elasticsearch/model/naming.rb, line 77
def index_name=(name)
  @index_name = name
end