Skip to content

Solr in Ursus

Parinita Mulak edited this page Oct 2, 2026 · 2 revisions

Solr in Ursus

Ursus uses Apache Solr as its search and discovery index. The application uses Blacklight to query Solr and uses the returned Solr documents to support:

  • searching and browsing UCLA Library Digital Collections
  • displaying collection and item records
  • facets, filters, and sorting
  • collection membership and relationships
  • record-level discovery and access checks
  • IIIF / Universal Viewer integration
  • OAI-PMH metadata delivery
  • sitemap generation

Ursus is primarily a consumer of the Solr index. The indexing pipeline and Solr infrastructure are maintained separately.

System overview

Three repositories are involved in the Ursus/Solr ecosystem:

Repository Responsibility
feed_ursus Transforms source metadata and indexes records into Solr
calursus-solr Defines the Solr Docker image, schema, field types, and Solr configuration
ursus Queries Solr through Blacklight and presents collections/items to users
flowchart LR
    A["feed_ursus<br/>Indexing"] -->|writes documents| B["Apache Solr<br/>core: ursus"]
    C["calursus-solr<br/>Schema & configuration"] -->|configures| B
    B -->|searches / retrieves documents| D["Ursus<br/>Rails + Blacklight"]
Loading

Repository responsibilities

feed_ursus is responsible for creating the Solr documents consumed by Ursus. Questions about where a field originates, how source metadata is transformed, why a value was indexed, or how records are added or updated generally belong in feed_ursus.

calursus-solr provides the Solr configuration used by Ursus, including the schema, dynamic field definitions, field types and analyzers, search request handlers, permission request handler, and sorting behavior.

ursus is the public-facing Rails/Blacklight application. It queries the Solr index and uses Solr documents for search, browse, collection pages, item pages, metadata presentation, OAI-PMH, and related functionality.

The ursus Solr core

The standalone Docker development environment uses a Solr core named ursus.

Inside the Docker network, Ursus connects to:

http://solr:8983/solr/ursus

The development Solr container runs on port 8983. A separate solr_test container is used for tests; it runs on port 8983 inside its container and is exposed as port 8985 on the host.

The application obtains these URLs through SOLR_URL and SOLR_TEST_URL.

See Local Solr Development for the complete Docker setup and commands.

Local development data

The standalone Ursus Docker environment uses a local sample dataset.

The solrload Docker service loads JSONL files from the Ursus fixtures directory into the local ursus core using feed_ursus loaddump.

Important: Local Solr data should not be assumed to be identical to the production Solr index. The local fixtures provide predictable data for development and testing. Production indexing is handled separately by the feed_ursus indexing workflow.

How Ursus uses Solr

flowchart TD
    A["Browser"] --> B["Ursus / Rails"]
    B --> C["Blacklight"]
    C --> D["SearchBuilder"]
    D --> E["Solr<br/>core: ursus"]
    E --> F["SolrDocument"]
    F --> G["Search & Browse"]
    F --> H["Collection / Item Pages"]
    F --> I["OAI-PMH"]
    F --> J["IIIF metadata"]
Loading

SearchBuilder currently relies primarily on Blacklight's standard Solr search behavior together with Blacklight Range Limit support.

SolrDocument represents records returned from Solr inside Ursus. Ursus uses ark_ssi as the application's unique document key.

Search and discovery

Ursus searches the ursus core through Blacklight. The normal public catalog query is restricted to documents that:

  • have an ARK
  • represent a Work or Collection
  • have public discovery access

Conceptually:

ark_ssi:*
AND
(has_model_ssim:Work OR has_model_ssim:Collection)
AND
discover_access_group_ssim:public

See Search and Browse for the complete query flow.

Collection and item pages

Solr is not used only for search. After Ursus retrieves a record, the resulting SolrDocument supplies metadata for the collection or item page.

Solr
  ↓
SolrDocument
  ↓
Blacklight document presenter
  ↓
Ursus metadata presenter
  ↓
metadata YAML configuration
  ↓
Collection / Item page

When a field exists in Solr but does not appear on a page, the problem may be in the Blacklight field configuration, Ursus presenter configuration, metadata YAML, or view rather than in Solr itself.

IIIF and Universal Viewer

Item pages can use IIIF information stored in the Solr document. Important fields include:

iiif_manifest_url_ssi
access_copy_ssi
thumbnail_url_ss

The actual IIIF image/viewer infrastructure is a separate service from Ursus. This documentation describes how Ursus obtains and uses IIIF-related metadata, but does not assume that downstream IIIF authorization is controlled by Ursus.

OAI-PMH

Ursus exposes records through an OAI-PMH provider. OAI metadata is generated from the same Solr documents used by the application.

Supported/customized metadata representations include:

  • Dublin Core
  • MODS
  • UCLA's DPLA metadata format

See OAI-PMH and Metadata Formats for the mappings and provider architecture.

Solr field naming

Many fields in the ursus index follow dynamic-field naming conventions, for example:

title_tesim
ark_ssi
member_of_collections_ssim
year_isim
date_dtsort

The suffix determines properties such as data type, whether the field is indexed/searchable, whether the original value is stored, whether it can contain multiple values, and whether it is intended for sorting.

See Solr Field Naming and Types before adding or changing a Solr field.

Note

Documentation in progress

This Solr documentation is currently being developed. Some pages and links referenced below have not been created yet and will be added as the documentation is completed.

Wiki guide

I want to understand... Wiki page
How Ursus, Solr, feed_ursus, and calursus-solr fit together Architecture
How to run and inspect Solr locally Local Solr Development
How search queries reach Solr Search and Browse
What _tesim, _ssi, _ssim, etc. mean Solr Field Naming and Types
Important fields used by Ursus Important Solr Fields
How a Solr record becomes an Ursus document Solr Documents and Metadata
How Works and Collections relate Collections and Relationships
Why a record is or is not discoverable Access Control and Discovery
How metadata reaches an item/collection page Show Pages and Universal Viewer
How Solr records become DC, MODS, or DPLA records OAI-PMH and Metadata Formats
Something isn't working Solr Troubleshooting

Quick mental model

Where did this field/value come from?
        ↓
    feed_ursus

How is this field indexed/analyzed?
        ↓
  calursus-solr

How is the field searched, displayed,
faceted, filtered, or exported?
        ↓
      Ursus

Clone this wiki locally