Class: Geoblacklight::Relation::Descendants
- Inherits:
-
Object
- Object
- Geoblacklight::Relation::Descendants
- Defined in:
- lib/geoblacklight/relation/descendants.rb
Instance Method Summary collapse
- #create_search_params ⇒ Object
- #execute_query ⇒ Object
-
#initialize(id, field, repository) ⇒ Descendants
constructor
A new instance of Descendants.
- #results ⇒ Object
Constructor Details
#initialize(id, field, repository) ⇒ Descendants
Returns a new instance of Descendants.
6 7 8 9 10 |
# File 'lib/geoblacklight/relation/descendants.rb', line 6 def initialize(id, field, repository) @search_id = id @field = field @repository = repository end |
Instance Method Details
#create_search_params ⇒ Object
12 13 14 15 16 |
# File 'lib/geoblacklight/relation/descendants.rb', line 12 def create_search_params {fq: "#{@field}:#{@search_id}", fl: [Geoblacklight.configuration.fields.title, Geoblacklight.configuration.fields.id, Geoblacklight.configuration.fields.resource_type]} end |
#execute_query ⇒ Object
18 19 20 21 22 23 |
# File 'lib/geoblacklight/relation/descendants.rb', line 18 def execute_query @repository.connection.send_and_receive( @repository.blacklight_config.solr_path, params: create_search_params ) end |
#results ⇒ Object
25 26 27 28 |
# File 'lib/geoblacklight/relation/descendants.rb', line 25 def results response = execute_query response["response"] end |