Class: Geoblacklight::Relation::Ancestors
- Inherits:
-
Object
- Object
- Geoblacklight::Relation::Ancestors
- Defined in:
- lib/geoblacklight/relation/ancestors.rb
Instance Method Summary collapse
- #create_search_params ⇒ Object
- #execute_query ⇒ Object
-
#initialize(id, field, repository) ⇒ Ancestors
constructor
A new instance of Ancestors.
- #results ⇒ Object
Constructor Details
#initialize(id, field, repository) ⇒ Ancestors
Returns a new instance of Ancestors.
6 7 8 9 10 |
# File 'lib/geoblacklight/relation/ancestors.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/ancestors.rb', line 12 def create_search_params {fq: ["{!join from=#{@field} to=#{Settings.FIELDS.ID}}#{Settings.FIELDS.ID}:#{@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/ancestors.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/ancestors.rb', line 24 def results response = execute_query response["response"] end |