Class: AgnosticBackend::Cloudsearch::Index
- Defined in:
- lib/agnostic_backend/cloudsearch/index.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
readonly
Returns the value of attribute access_key_id.
-
#document_endpoint ⇒ Object
readonly
Returns the value of attribute document_endpoint.
-
#domain_name ⇒ Object
readonly
Returns the value of attribute domain_name.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#search_endpoint ⇒ Object
readonly
Returns the value of attribute search_endpoint.
-
#secret_access_key ⇒ Object
readonly
Returns the value of attribute secret_access_key.
Instance Method Summary collapse
- #cloudsearch_client ⇒ Object
- #cloudsearch_domain_client ⇒ Object
- #configure ⇒ Object
- #indexer ⇒ Object
-
#initialize(indexable_klass, **options) ⇒ Index
constructor
A new instance of Index.
- #query_builder ⇒ Object
- #schema ⇒ Object
Methods inherited from Index
Constructor Details
#initialize(indexable_klass, **options) ⇒ Index
Returns a new instance of Index.
12 13 14 15 16 17 18 19 20 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 12 def initialize(indexable_klass, **) super(indexable_klass) @region = parse_option(, :region) @domain_name = parse_option(, :domain_name) @document_endpoint = parse_option(, :document_endpoint) @search_endpoint = parse_option(, :search_endpoint) @access_key_id = parse_option(, :access_key_id) @secret_access_key = parse_option(, :secret_access_key) end |
Instance Attribute Details
#access_key_id ⇒ Object (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_endpoint ⇒ Object (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_name ⇒ Object (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 |
#region ⇒ Object (readonly)
Returns the value of attribute region.
5 6 7 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 5 def region @region end |
#search_endpoint ⇒ Object (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_key ⇒ Object (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_client ⇒ Object
38 39 40 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 38 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_client ⇒ Object
42 43 44 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 42 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 |
#configure ⇒ Object
34 35 36 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 34 def configure define_fields_in_domain(indexer.flatten(schema)) end |
#indexer ⇒ Object
22 23 24 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 22 def indexer AgnosticBackend::Cloudsearch::Indexer.new(self) end |
#query_builder ⇒ Object
26 27 28 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 26 def query_builder AgnosticBackend::Queryable::Cloudsearch::QueryBuilder.new(self) end |
#schema ⇒ Object
30 31 32 |
# File 'lib/agnostic_backend/cloudsearch/index.rb', line 30 def schema @schema ||= @indexable_klass.schema{|ftype| ftype} end |