Skip to content
This repository

Add a Solr-backed search interface to Omeka.

Octocat-spinner-32 .tx Add config for Transifex. August 16, 2012
Octocat-spinner-32 addons Gets rid of un-maintained changelog. March 26, 2014
Octocat-spinner-32 controllers Moves the faceting options into a consolidated 'Results Configuration… March 26, 2014
Octocat-spinner-32 forms Moves the faceting options into a consolidated 'Results Configuration… March 26, 2014
Octocat-spinner-32 helpers Moves the faceting options into a consolidated 'Results Configuration… March 26, 2014
Octocat-spinner-32 jobs Use a background process for the reindexing. March 20, 2014
Octocat-spinner-32 languages Renames SolrSearchFacet -> SolrSearchField, since that's what it actu… February 20, 2014
Octocat-spinner-32 lib When indexing an item, just work with the indexed/faceted fields, whi… March 26, 2014
Octocat-spinner-32 models Further optimizes the item indexing. March 26, 2014
Octocat-spinner-32 solr-core Renames _fl/_hl to _s/_t for consistency. March 25, 2014
Octocat-spinner-32 tests Gets rid of un-maintained changelog. March 26, 2014
Octocat-spinner-32 views Renames the 'highlight' admin route to 'results'. March 26, 2014
Octocat-spinner-32 .gitignore Gets rid of unused bower configuration. March 26, 2014
Octocat-spinner-32 Gemfile Implements Grunt Compass task. January 28, 2014
Octocat-spinner-32 Gruntfile.js Gets rid of unused bower configuration. March 26, 2014
Octocat-spinner-32 LICENSE First checkin for the license October 06, 2009
Octocat-spinner-32 README.md Readme tweaks. March 27, 2014
Octocat-spinner-32 SolrSearchPlugin.php Moves the faceting options into a consolidated 'Results Configuration… March 26, 2014
Octocat-spinner-32 composer.json Gets rid of __construct method in plugin class that automatically cal… January 27, 2014
Octocat-spinner-32 composer.lock Gets rid of __construct method in plugin class that automatically cal… January 27, 2014
Octocat-spinner-32 package.json Gets rid of unused bower configuration. March 26, 2014
Octocat-spinner-32 plugin.ini Bumps version to 2.0.0. March 26, 2014
Octocat-spinner-32 plugin.php Moves the faceting options into a consolidated 'Results Configuration… March 26, 2014
Octocat-spinner-32 routes.ini Renames the 'highlight' admin route to 'results'. March 26, 2014
README.md

SolrSearch

Solr

SolrSearch replaces the default Omeka search interface with one powered by Solr, a scalable and feature-rich search engine that supports faceting and hit highlighting. In most cases, Omeka's built-in searching capabilities work great, but there are a couple of situations where it might make sense to take a look at Solr:

  • When you have a really large collection, and want something a bit faster;

  • When your site contains a lot of text content, and you want to take advantage of Solr's hit highlighting functionality, which displays a preview snippet from each of the matching records;

  • When your site makes use of a lot of different taxonomies (collections, item types, etc.), and you want to use Solr's faceting capabilities, which make it possible for users to refine searches by cropping down the set of results to focus on specific categories.

Requirements

To use the plugin, you'll need access to an installation of Solr 4.0+ running the core included in the plugin source code under solr-core/omeka. For general information about how to get up and running with Solr, check out the official installation documentation.

Installation

Solr Core

To deploy the Solr core, just copy the solr-core/omeka directory into your Solr home directory. For example, if your deployment is based on the default Solr 4 multicore template, you might end up with directories for core0, core1, and omeka. Once the directory is in place, restart/reload Solr to register the new core.

Omeka Plugin

Once the core is up and running, install SolrSearch just like any other Omeka plugin:

  1. Download the plugin from the Omeka addons repository and unzip the archive.

  2. Upload the SolrSearch directory into the Omeka plugins directory.

  3. Open up the "Plugins" page in Omeka and click the "Install" button for Solr Search.

For more information, check out the Managing Plugins guide.

Configuration

Server Configuration

To get started, click on the "Solr Search" tab, which displays a form with Solr connection parameters:

  • Server Host: The location of the Solr server, without the port number.

  • Server Port: The port that Solr is listening on.

  • Core URL: The URL of the Solr core in which documents should be indexed.

After making changes to the connection parameters, click the "Save Settings" button. If the plugin is able to connect to Solr, a greet notification saying "Solr connection is valid" will be displayed.

Field Configuration

This form makes it possible to configure (a) which metadata elements and Omeka categories ("fields") are stored as searchable content in Solr and (b) which fields should be used as "facets", groupings of records that can be used to iteratively narrow down the set of results. For each element, there are three options:

  • Facet Label: The label used as the heading for the facet corresponding to the field. In most cases, it probably just makes sense to use the canonical name as the element (the default), but this makes it possible to create a customized interface that doesn't map onto the nomenclature of the metadata.

  • Is Indexed?: If checked, the content in this field will be stored as full-text-searchable content in Solr. As a rule of thumb, it makes sense to index any fields that contain non-trivial text content, but not fields that contain non-semantic data or identifiers.

  • Is Facet?: If checked, the field will be used as a facet in the results. As a rule of thumb, a field might be a useful facet if it contains a controlled vocabulary. For example, imagine you use one of three values in the Dublin Core "Type" field - type1, type2, and type3. This would make a good facet, because users would be able to hone in on the implicit relationships among items of the same type. It wouldn't make sense to use something like the "Description" field as a facet, though, two items will almost never share the exact same description (or, at least, they probably shouldn't!).

Use the accordion to expand and contract the fields in the three categories. There are two types of fields - the "Omeka Categories," which aren't actually metadata elements but rather high-level taxonomies that are baked in to the struture of Omeka, and the metadata elements (Dublin Core and Item Type Metadata) that can be used to describe items.

After you've made changes, click the "Update Search Fields" to save the configuration.

Results Configuration

This form exposes options for two features in Solr: hit highlighting, which makes it possible to display preview snippets for each result that excerpt portions of the metadata that are relevant to the query, and faceting, which makes it possible for users to progressively refine large result sets by honing in on specific categories.

  • Enable Highlighting: Set whether highlighting snippets should be displayed.

  • Number of Snippets: The maximum number of snippets to display for a result.

  • Snippet Length: The maximum length of each snippet.

  • Facet Ordering: The criteria by which to sort the facets in the results.

  • Facet Count: The maximum number of facets to display.

Click "Save Settings" to update the configuration.

Index Items

After making changes in the "Field Configuration" and "Results Configuration" tabs, it's necessary to reindex the content in the site in order for the changes to take effect. SolrSearch doesn't do this automatically because reindexing can take as long as a few minutes for really large sites.

When you're ready, just click the "Clear and Reindex" button. This will spawn off a background process behind the scenes that rebuilds the index according to the new configuration options.

Searching

Once the content has been indexed, head to the public site and type a seaarch query into the regular Omeka search input. When the query is submitted, SolrSearch will intercept the request and redirect to a custom interface that displays results from Solr with faceting and hit highlighting.

Something went wrong with that request. Please try again.