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 |
# File 'lib/geoblacklight/relation/descendants.rb', line 12 def create_search_params {fq: "#{@field}:#{@search_id}", fl: [Settings.FIELDS.TITLE, Settings.FIELDS.ID, Settings.FIELDS.RESOURCE_TYPE]} end |
#execute_query ⇒ Object
17 18 19 20 21 22 |
# File 'lib/geoblacklight/relation/descendants.rb', line 17 def execute_query @repository.connection.send_and_receive( @repository.blacklight_config.solr_path, params: create_search_params ) end |
#results ⇒ Object
24 25 26 27 |
# File 'lib/geoblacklight/relation/descendants.rb', line 24 def results response = execute_query response["response"] end |