Class: BlacklightIiifSearch::IiifSuggestSearch
- Inherits:
-
Object
- Object
- BlacklightIiifSearch::IiifSuggestSearch
- Defined in:
- app/models/blacklight_iiif_search/iiif_suggest_search.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#document_id ⇒ Object
readonly
Returns the value of attribute document_id.
-
#iiif_config ⇒ Object
readonly
Returns the value of attribute iiif_config.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize(params, repository, controller) ⇒ IiifSuggestSearch
constructor
A new instance of IiifSuggestSearch.
-
#response ⇒ IIIF::OrderedHash
Return the termList response.
-
#suggest_results ⇒ RSolr::HashWithResponse
Query the suggest handler rubocop:disable Style/HashSyntax.
Constructor Details
#initialize(params, repository, controller) ⇒ IiifSuggestSearch
Returns a new instance of IiifSuggestSearch.
13 14 15 16 17 18 19 20 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 13 def initialize(params, repository, controller) @params = params @query = params[:q] @document_id = params[:solr_document_id] @iiif_config = controller.iiif_search_config @repository = repository @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def controller @controller end |
#document_id ⇒ Object (readonly)
Returns the value of attribute document_id.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def document_id @document_id end |
#iiif_config ⇒ Object (readonly)
Returns the value of attribute iiif_config.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def iiif_config @iiif_config end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def params @params end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def query @query end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
6 7 8 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 6 def repository @repository end |
Instance Method Details
#response ⇒ IIIF::OrderedHash
Return the termList response
25 26 27 28 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 25 def response response = IiifSuggestResponse.new(suggest_results, params, controller) response.term_list end |
#suggest_results ⇒ RSolr::HashWithResponse
Query the suggest handler rubocop:disable Style/HashSyntax
34 35 36 37 38 |
# File 'app/models/blacklight_iiif_search/iiif_suggest_search.rb', line 34 def suggest_results suggest_params = { q: query, :'suggest.cfq' => document_id } repository.connection.send_and_receive(iiif_config[:autocomplete_handler], params: suggest_params) end |