Class: Spotlight::SolrController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Spotlight::SolrController
- Includes:
- SearchHelper
- Defined in:
- app/controllers/spotlight/solr_controller.rb
Overview
Proxy update requests to Solr and inject spotlight's exhibit specific fields.
This is an example of how you could integrate external indexing workflows with exhibit-specific content
Instance Method Summary collapse
Methods included from SearchHelper
#search_service, #search_service_context
Instance Method Details
#update ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/spotlight/solr_controller.rb', line 19 def update :update_solr, @exhibit data = solr_documents unless data.empty? repository.connection.update params: { commitWithin: 500 }, data: data.to_json, headers: { 'Content-Type' => 'application/json' } end if params[:resources_json_upload] redirect_back_or_to(exhibit_resources_path(@exhibit)) else head :ok end end |