Releases: projectblacklight/blacklight
Blacklight 6.0.0.pre3
Major Changes
Supported Dependencies
Blacklight 6 requires Rails 4.1 (or greater). Among other features, Blacklight uses the Rails.application.secrets
to generate temporary links for exported user content. Ruby on Rails provides helpful guides on how to migrate existing applications:
Blacklight also requires Ruby 2.0 or greater.
Blacklight also requires Solr 4, and Solr 5 is strongly recommended.
Routing changes
Blacklight now provides resourceful routing concerns that are mixed into an application's routes. The replaces the blacklight_for
routing method. The intent is to create more explicit routing within the application in order to provide more visibility of Blacklight's routing expectations.
With the new routing, applications can create resourceful controllers to provide a Blacklight search experience:
# with a singular resource:
resource :catalog, only: [:index] do
concerns :searchable
end
# or resources:
resources :searchable_objects do
collection do
concerns :searchable
end
end
Two other routing changes are:
- the blacklight engine provides routes for the search history and saved searches, and must be mounted within your application:
mount Blacklight::Engine => '/'
- minor changes to named routes to better align with Rails resourceful routing. In particular,
catalog_index_path
is nowsearch_catalog_path
.
Blacklight::SearchBuilder
Blacklight provides a standard API for mapping user parameters to back-end query parameters. This replaces the controller-level .search_params_logic
with a mapping class.
Instead of adding search_params_logic
to your controller you will need to set up a default_processor_chain into your SearchBuilder. This means that instead of modifying your controller on the fly you can set up different SearchBuilders that encapsulate your search logic. This change should make it easier to test your search logic.
See the upgrade notes for how to convert your search_params_logic
into SearchBuilder.
Blacklight::Path
Blacklight provides many URL helpers for generating search urls, and in Blacklight 6.x we've consolidated these methods in a Blacklight::Path
class, which is made available to the controllers and helpers.
We've provided deprecation warnings, where appropriate, for the old helper methods, and will remove those helpers in Blacklight 7.
HTML markup and CSS changes
We've made minor changes to the Blacklight HTML markup to meet Web Content Accessibility Guidelines level AA. In particular, this meant:
- re-aligning HTML header element, to ensure a consistent hierarchy in a page [https://github.com/projectblacklight/blacklight/commit/c4bf4871a38e8fcbf665e01344ff8a0f283ddff0]
We've also tried to clean up some of the provided CSS by creating smaller, more targeted SCSS files and remove styles that were not currently used by Blacklight [https://github.com//pull/1245]
Class and Module reorganization
We've moved many of the classes and modules in ./lib/blacklight
into the ./app
directory hierarchy in order to clarify the intended consumers for these model and controller mixins.
Remove deprecated code and views
Deprecated methods and templates have been marked as deprecated in Blacklight 5.x releases and have been removed in Blacklight 6.0.
- Removed unused i18n keys [https://github.com/projectblacklight/blacklight/commit/e56214d8ad3d883172fe68a2d9313c36c02196b6]
- Removed default Solr
qt
parameter [https://github.com//pull/1219] - Removed code that supported Ruby 1.9 and Rails 4.0
- Remove code that supported Solr 1.4 and Solr 3.
Features
- Add support for Rails 4 global ids for
Blacklight::Document
classes [https://github.com//pull/1222] - Add a simple search query autocomplete endpoint using twitter's typeahead library. [https://github.com//pull/1288]
Improvements
- Improve facet wrapping and hyphenation to deal with long facet labels or counts. [https://github.com//pull/1263]
- Add facet prefix filtering when paginating within a facet [https://github.com//pull/1262]
- Use Rails'
#to_sentence
helper when rendering multivalued fields
Upgrade guide
-
Update your application to the latest Blacklight 5.x release (5.16.3, as of this writing) to receive notices of deprecated behaviors used in your local application.
-
Add explicit dependencies, as needed, to your application's
Gemfile
for:gem 'rsolr' # and gem 'blacklight-marc'
-
Update your routes to use the new resourceful routing scheme. Replace:
blacklight_for :catalog # or Blacklight.add_routes(self)
with explicit routing:
mount Blacklight::Engine => '/' concern :searchable, Blacklight::Routes::Searchable.new concern :exportable, Blacklight::Routes::Exportable.new resource :catalog, only: [:index], controller: 'catalog' do concerns :searchable end resources :solr_documents, only: [:show], controller: 'catalog' do concerns :exportable end resources :bookmarks do concerns :exportable collection do delete 'clear' end end
Note that there are a handful of named routing changes from the Blacklight 5.x routes, including:
catalog_index_path
is nowsearch_catalog_path
catalog_facet_path
is nowfacet_catalog_path
catalog_path
is nowsolr_document_path
citation_catalog_path
is nowcitation_solr_document_path
These changes help align Blacklight with Rails routing conventions.
-
If you haven't yet created the
SearchBuilder
, create a default search builder by running the generator$ rails generate blacklight:search_builder
-
Replace
search_params_logic
in your Controllers withdefault_processor_chain
in yourSearchBuilder
.For any place in your Controllers where you call e.g.
self.search_params_logic = [ <array of methods>]
remove that from the controller and add it toapp/models/search_builder.rb
with lineself.default_processor_chain += [<array of methods>]
.For example if your CatalogController originally looks like this:
class CatalogController < ApplicationController include Blacklight::Catalog self.search_params_logic += [:show_my_records] def show_my_records <do stuff to show my records> end ... end
Your catalog will then look like
class CatalogController < ApplicationController include Blacklight::Catalog ... end
and your SearchBuilder will look like this
class SearchBuilder < Blacklight::SearchBuilder include Blacklight::Solr::SearchBuilderBehavior self.default_processor_chain += [:show_my_records] def show_my_records <do stuff to show my records> end end
Contributors
Thanks, as always, to every contributor who helped with this release, including:
Blacklight 5.16.3
This release backports features in Blacklight 6, and adds deprecation warnings for methods being removed from the upcoming Blacklight 6.0 release.
New Features and improvements
- #1272 Backport Blacklight 6.x code reorganization, moving many classes from
./lib
into./app
- e9c95ee Allow show tool actions to skip defining an accessor method
Bug Fixes
- #1256 c119f0c return an empty result set instead of throwing exception when a custom facet query value that does not exist
- #1280 Next/previous buttons should maintain the current search session
- 6f0c253 Remove reference to
Blacklight::Catalog::SearchHistoryWindow
from the default Blacklight configuration
Upgrade Notes
If you were using Blacklight::Catalog::SearchHistoryWindow
to control the size of the user's search history, you must use search_history_window
, e.g.:
configure_blacklight do |config|
config.search_history_window = 10
end
Blacklight v5.15.0
This release back-ports some features from expected upcoming BL 6.0 into BL 5.x.
New Features and improvements
- #1239 SearchHelper#search_results takes optional block allowing per-call customization of processor chain using a SearchBuilder.
- b85fbb4 Atom feed title uses presenter only.
- 5d7082d Allow spellcheck collation to support Solr 5 json response format
- 21c232f Add Json-ld Sitelinks search to default catalog/index view
- 1bd4122 Move link_rel_alternates to the DocumentPresenter
- bc3be14 Create a generic FacetPaginator class, Solr::FacetPaginator sub-classes it.
Bug Fixes
- c4b93f0 When SearchBuilder has a NameError raise it.
- 29a59b8 Encode the search in the page title and use consistent page titles for increased context for screen readers
Upgrade Notes
None.
Blacklight v5.14.0
This release is the intended as the last release before Blacklight 6.0.0
New Features and improvements
#1213 #1211 removes vestigial keys from various translations
#1203 Makes facet paginator class configurable
#1202 Adds Italian translation
#1201 Adds a cache key to Blacklight::Document
#1199 Facet paths now can have a configurable url
Bug Fixes
#1211 fixes a bug with has_facet_values? so it returns false if values are not displayable
Blacklight 5.13.1
v5.13.0
Improvements and Bug fixes
#1177 Refactor #render_document_heading
to be more lenient about what document types it accepts
#1178 Move the repository connection information into the blacklight config
#1179 Pass the Blacklight::SearchBuilder
object to the repository instance, instead of just the processed parameters
#1180 Add helper methods for layout classes, so implementations can more easily override the column layout
#1183, #1185 Delegate additional hash methods in Blacklight::OpenStructWithHashAccess
#1187 Fix regression in SolrRepository#find
behavior, to use default_document_solr_params[:q]
before document_solr_request_handler
.
Blacklight 5.12.1
Changes
#1174 Relax kaminari dependency, so implementation can use Kaminari 1.0.0.alpha release candidates
#1175 Extract Blacklight::Document::ActiveModelShim from Blacklight::Document, so Document implementations that don't need the shim can easily exclude it
#1175 Use @response.start
method instead of digging into the response parameters
Blacklight 5.12.0
Improvements and Bug fixes
#1157 Update #facet_in_params
and #facet_field_in_params?
helpers to use the blacklight facet configuration
#1159 Use polymorphic routing for the search session tracking route instead of hard-coding track_solr_document_path
#1157 Add fluent SearchBuilder for start/page/rows parameters
#1152 Provide a blacklight:search_builder
generator to generate an application-specific Blacklight::SearchBuilder
into the application
#1164 Add Document#fetch
to replace deprecated Document#get
method
#1162 Add Blacklight::SolrReponse#aggregations
to replace #facets
, #facet_queries
, etc.
#1166 Update Blacklight configuration's dynamic field matching to support an explicit :match
option with a regular expression.
#1171 Fix Blacklight bookmarks error with Rails 4.2.1
#1173 Convert "Clear Bookmarks" button to a results collection tool
#1165 Only use backwards-compatible configuration options (e.g. include_in_simple_select
) when if
or unless
options are not used
Upgrade notes
If you were taking advantage of SolrDocument#to_model
to convert your Solr responses into other model classes, note that #1159 will use your #to_model
object to calculate the route name.
In #1164, a new method #fetch
was added to SolrDocument. If you were using a method of the same name (because you mixed Blacklight::SearchHelper
into your model, say), you may have unexpected behavior.
Blacklight 5.11.2
Blacklight 5.11.1
Bug Fixes
#1149 Facet URL helpers should use the facet configuration to determine the key to use in the query parameters