Method: Elasticsearch::Persistence::Repository#initialize

Defined in:
lib/elasticsearch/persistence/repository.rb

#initialize(options = {}) ⇒ Object

Initialize a repository instance.

Examples:

Initialize the repository.

MyRepository.new(index_name: 'notes', klass: Note)

Parameters:

  • options (Hash) (defaults to: {})

    The options to use.

Options Hash (options):

  • :index_name (Symbol, String)

    The name of the index.

  • :client (Symbol, String)

    The client used to handle requests to and from Elasticsearch.

  • :klass (Symbol, String)

    The class used to instantiate an object when documents are deserialized. The default is nil, in which case the raw document will be returned as a Hash.

  • :mapping (Elasticsearch::Model::Indexing::Mappings, Hash)

    The mapping for this index.

  • :settings (Elasticsearch::Model::Indexing::Settings, Hash)

    The settings for this index.

Since:

  • 6.0.0

[View source]

104
105
106
# File 'lib/elasticsearch/persistence/repository.rb', line 104

def initialize(options = {})
  @options = options
end