Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dor_indexing

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dor_indexing

  • 2.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gem Version CircleCI Test Coverage

DorIndexing

DorIndexing is a Ruby gem that creates Solr documents from Cocina objects for the purposes of indexing. It was extracted from DOR Indexing App.

Motivation

In our previous architecture, rolling indexing was performed on the Dor Indexing App server. This was inefficient and slow, as it required API calls to Dor Services App to retrieve Cocina items.

Gemifying the creation of Solr documents allows changing the architecture such that rolling indexing is performed on the Dor Services App server. This allows the more efficient retrieval of Cocina items via direct ActiveRecord db access.

Further, it allows other indexing (e.g., via RabbitMQ messages) to continue on the Dor Indexing App server.

Installation

Install the gem and add to the application's Gemfile by executing:

$ bundle add dor_indexing

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install dor_indexing

Usage

DorIndexing requires interaction with the SDR workflow API and also needs the following:

  • a callable that takes a single argument (a druid) and returns the Cocina for the corresponding object
  • a callable that takes a single argument (a druid) and returns the list of administrative tags for the corresponding object
  • a callable that takes a single argument (a druid) and returns the list of release tags for the corresponding object
require 'dor_indexing'

doc = DorIndexing.build(
  cocina_with_metadata:,
  workflow_client:,
  cocina_finder:,
  administrative_tags_finder:,
  release_tags_finder:
)

Testing

Integration Testing with Solr

We build and update the Solr index via dor-indexing-app amd dor-services-app, both of which use this gem for indexing logic.

Argo is the blacklight app that uses the Solr index extensively, and it already has the docker containers to create new test objects in dor-services-app and index them (via dor_indexing_app to Solr). And Argo is the app built on top of the Solr index, so a good place to check results.

To ensure our indexing behavior produces the desired results, it was easiest to put the full stack integration tests in the argo repository -- they can be found in https://github.com/sul-dlss/argo/tree/main/spec/features/indexing_xxx_spec.rb

FAQs

Package last updated on 04 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc