Sarnia allows a Drupal 7.x site to interact with and display data from Solr cores with arbitrary (non-Drupal) schemas, mainly by building Views. This is useful for Solr cores that index large, external (non-Drupal) datasets that are either not practical to store in Drupal or may already be indexed in Solr.

Drupal 8/9 Support: This module's functionality is now included in Search API Solr module for Drupal 8, version 8.x-3.0 and later, as the "Solr Document" datasource support. Search API Solr 8.x-4.0 and later support Drupal 9.

Sarnia treats records from Solr as Drupal entities, although listing, filtering, and displaying Sarnia entities should be done using Views. Solr properties can be formatted within Views fields using field formatters (hook_field_formatter_info(), hook_field_formatter_view()).

There is user documentation with screenshots in the handbook.

This module depends on Search API, Search API Solr, and Views.

Latest development

  • The current release version has been patched and tested to work with the latest Search API and Search API Solr, and is now the stable release. The included documentation has been updated.
  • There is now working FacetAPI integration (requires search_api_facetapi, which is included in the Search API project)
  • Date facets are supported on fields declared as solr.TrieDateField ("tdate"). It may be necessary (depending on the version of Solr) to force disabling of fulltext search on fields declared as solr.TrieDateField, by setting rules in the "Fulltext search" section on the "Solr Schema" tab of a Sarnia Server configuration item. See comment #9 in issue #2513444: Support for date fields/facets.
  • A patch was originally made where Sarnia handled filter testing for NULL values. This has now been removed in favor of allowing Search API to handle NULL testing. In limited cases, it may be necessary to review pre-existing Views. See #2496751: Delete SarniaViewsHandlerFilter::operator_options() and #1318904: Improved handling for NULL values in Views.
  • Views PHP can be made to work with Sarnia, with a few changes to Views PHP. #2582793: views php has the details.

This module was developed by Palantir.net, and sponsored by the Field Museum of Natural History. Development supported by OpenPlus.

Supporting organizations: 
Development support

Project information

Releases