Nectarguide is a Ruby on Rails engine (gem) that adds an autosuggest search feature to apps using the Project Blacklight gem. It helps library users better find what they are looking for.
The engine is named for patterns found on flowers, called nectar guides, that help pollinators find what they are looking for. Flower nectar guides are often visible under ultraviolet light (black light).
Nectarguide provides search suggestions based upon user-entered strings. The suggestsions are divided into Subject, Author, Location, Genres, etc.
Here is how it looks in action:
Nectarguide is intended for any library catalog or repository app that uses Blacklight.
You will have to add the Nectarguide gem to a gem source, or clone the repository into your filesystem.
Add this line to your application's Gemfile, somewhere above the line that installs Blacklight:
gem 'nectarguide', :path => "../"
If you have cloned the gem, you will have to include the path to the location in which you cloned the gem. If not, you may omit the :path
portion.
In your project's .env file, specify a Solr endpoint that will produce requests according to the engine's expectations:
AUTOSUGGEST_URL=http://test.edu:8983/solr
Add these lines to your app's app/assets/javascripts/applicaiton.js file:
//= require blacklight/autosuggest.js
//= require jquery-ui/widgets/autocomplete
The second line, which adds a jQuery library, only need be added if not already present.
- Add this to your app's app/assets/stylesheets/application.css.scss file:
/*
*= require 'jquery-ui.min.css'
*/
@import "search-form";
Once again, you don't need to add the jQuery part if your applicaiton is already using jQuery-
Get in touch with http://ld4p.org/ to learn more. This repo was started by John Skiles Skinner using code written by Tim Worrall and Huda Khan as part of the LD4P grant, funded by the Andrew W. Mellon Foundation.
Open source under the MIT License.