Class: Blacklight::AbstractRepository
- Inherits:
-
Object
- Object
- Blacklight::AbstractRepository
- Includes:
- ActiveSupport::Benchmarkable
- Defined in:
- lib/blacklight/abstract_repository.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#blacklight_config ⇒ Object
Returns the value of attribute blacklight_config.
- #connection ⇒ Object
-
#logger ⇒ Object
writeonly
ActiveSupport::Benchmarkable requires a logger method.
Instance Method Summary collapse
-
#find(id, params = {}) ⇒ Object
Find a single document result by a known id.
-
#initialize(blacklight_config) ⇒ AbstractRepository
constructor
A new instance of AbstractRepository.
-
#ping ⇒ Object
Is the repository in a working state?.
-
#reflect_fields ⇒ Hash
Query the fields that exist from the index.
-
#search(params = {}) ⇒ Object
Execute a search query against a search index.
Constructor Details
#initialize(blacklight_config) ⇒ AbstractRepository
Returns a new instance of AbstractRepository.
12 13 14 |
# File 'lib/blacklight/abstract_repository.rb', line 12 def initialize blacklight_config @blacklight_config = blacklight_config end |
Instance Attribute Details
#blacklight_config ⇒ Object
Returns the value of attribute blacklight_config.
4 5 6 |
# File 'lib/blacklight/abstract_repository.rb', line 4 def blacklight_config @blacklight_config end |
#connection ⇒ Object
16 17 18 |
# File 'lib/blacklight/abstract_repository.rb', line 16 def connection @connection ||= build_connection end |
#logger=(value) ⇒ Object
ActiveSupport::Benchmarkable requires a logger method
8 9 10 |
# File 'lib/blacklight/abstract_repository.rb', line 8 def logger=(value) @logger = value end |
Instance Method Details
#find(id, params = {}) ⇒ Object
Find a single document result by a known id
24 25 26 |
# File 'lib/blacklight/abstract_repository.rb', line 24 def find(id, params = {}) raise NotImplementedError end |
#ping ⇒ Object
Is the repository in a working state?
43 44 45 |
# File 'lib/blacklight/abstract_repository.rb', line 43 def ping raise NotImplementedError end |
#reflect_fields ⇒ Hash
Query the fields that exist from the index
37 38 39 |
# File 'lib/blacklight/abstract_repository.rb', line 37 def reflect_fields raise NotImplementedError end |
#search(params = {}) ⇒ Object
Execute a search query against a search index
31 32 33 |
# File 'lib/blacklight/abstract_repository.rb', line 31 def search(params = {}) raise NotImplementedError end |