No description, website, or topics provided.
Clone or download
Pull request Compare This branch is 2 commits ahead, 4 commits behind cbeer:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app/views/catalog
assets
lib
spec
Gemfile
Gemfile.lock
README.rdoc
Rakefile
VERSION
blacklight_facet_extras.gemspec

README.rdoc

***THIS FORK JUST UPDATES THE DOCUMENTATION***

BlacklightFacetExtras: Blacklight plugin that exposes Solr facet parameters (range, query, tagging + exclusions, etc) to Blacklight

Description

BlacklightFacetExtras adds some ugly parsing and manipulating to the Blacklight solr configuration and solr parameter parsing, but seems to get the job done, more or less.

Requirement

A Rails app using Blacklight >=3.2.

Installation

Add

gem “blacklight_facet_extras”

to your Gemfile and run “bundle install”.

For each “extras” component you plan to use, you need to mixin the appropriate extension into your Catalogcontroller, e.g. Either one.

include BlacklightFacetExtras::Pivot::ControllerExtension
include BlacklightFacetExtras::Query::ControllerExtension

Then you need this:

:add_query_facets_to_solr

Configuration

After mixing-in the controller extension, additional parameters will be available in your facet configuration:

CatalogController.configure_blacklight do |config|

    config.add_facet_field 'hierarchy_facet', :hierarchy => true
    config.add_facet_field 'facet', :multiple => true
    config.add_facet_field 'first_facet,last_facet', :pivot => ['first_facet', 'last_facet']
    config.add_facet_field 'my_query_field', :query => { 'label' => 'value:1', 'label2' => 'value:2'}
    config.add_facet_field 'facet', :single => true
    config.add_facet_field 'facet', :tag => 'my_tag', :ex => 'my_tag'

    config.default_solr_params[:'facet.field'] = config.facet_fields.keys
  end

What Query Parameters mean

'label' is the text that appears when you search
'value:1' is a solr query

In the example above, there will be two results, label1 will show any results that have value equal 1, and label2 will show any results that have value = 2

Testing

In general, the acceptance tests (in `spec/acceptance`) are your best bet for discovering configuration parameters.

If you do not have Blacklight add the Solr `facet.field` parameter, you may need to ensure your Solr request handler is configured to return appropriate results (especially for e.g. single + multiple select facets)