Class: AgnosticBackend::Cloudsearch::Index

Inherits:
Index
  • Object
show all
Defined in:
lib/agnostic_backend/cloudsearch/index.rb

Instance Attribute Summary collapse

Attributes inherited from Index

#options

Instance Method Summary collapse

Methods inherited from Index

#initialize, #name, #parse_option, #primary?

Constructor Details

This class inherits a constructor from AgnosticBackend::Index

Instance Attribute Details

#access_key_idObject (readonly)

Returns the value of attribute access_key_id.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def access_key_id
  @access_key_id
end

#document_endpointObject (readonly)

Returns the value of attribute document_endpoint.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def document_endpoint
  @document_endpoint
end

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def domain_name
  @domain_name
end

#regionObject (readonly)

Returns the value of attribute region.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def region
  @region
end

#search_endpointObject (readonly)

Returns the value of attribute search_endpoint.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def search_endpoint
  @search_endpoint
end

#secret_access_keyObject (readonly)

Returns the value of attribute secret_access_key.



5
6
7
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5

def secret_access_key
  @secret_access_key
end

Instance Method Details

#cloudsearch_clientObject



28
29
30
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 28

def cloudsearch_client
  @cloudsearch_client ||= Aws::CloudSearch::Client.new(region: region, access_key_id: access_key_id, secret_access_key: secret_access_key)
end

#cloudsearch_domain_clientObject



32
33
34
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 32

def cloudsearch_domain_client
  @cloudsearch_domain_client ||= Aws::CloudSearchDomain::Client.new(endpoint: search_endpoint, access_key_id: access_key_id, secret_access_key: secret_access_key)
end

#configureObject



24
25
26
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 24

def configure
  define_fields_in_domain(indexer.flatten(schema))
end

#indexerObject



12
13
14
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 12

def indexer
  AgnosticBackend::Cloudsearch::Indexer.new(self)
end

#query_builderObject



16
17
18
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 16

def query_builder
  AgnosticBackend::Queryable::Cloudsearch::QueryBuilder.new(self)
end

#schemaObject



20
21
22
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 20

def schema
  @schema ||= @indexable_klass.schema{|ftype| ftype}
end