Text Service is a Ruby on Rails application that provides a searchable, faceted text discovery interface backed by Apache Solr and Blacklight. It is designed to expose Danish text metadata and full-text search across a curated collection, with additional support for snippets, facsimile views, OAI harvesting, and user bookmarks.
- Full-text search for text documents using Blacklight and Solr
- Faceted navigation by year, author, location, text category, genre, and more
- Document detail pages with rich metadata and citation support
- User authentication and session management via Devise (including CAS integration)
- Search history and bookmark management
- Snippet rendering through an external text retrieval service
- Facsimile / image view support for document scans
- OAI endpoint support for metadata harvesting
- The root path is
GET /, which maps to the catalog search interface - Search results are exposed under
/text - Individual document pages are available through Solr-backed
solr_documents - Snippet rendering is accessible from
/comment/:id - Additional pages include periods, authors, and OAI metadata export
app/controllers/catalog_controller.rb- main search/catalog controller powered by Blacklightapp/controllers/search_history_controller.rb- search history supportapp/controllers/snippet_controller.rb- renders snippets from the external snippet serverapp/models/file_server.rb- proxies requests to the external text snippet and facsimile serviceconfig/text_service.yml- environment-specific external service configurationGemfile- application dependencies, including Rails, Blacklight, Solr client libraries, Devise, and Bootstrap
- Ruby 2.7.8 compatible
- Rails 5.2.8
- SQLite3 for local development database
- Apache Solr for search index backend
- External snippet/facsimile server configured in
config/text_service.yml - wkhtmltopdf for PDF generation via
wicked_pdf
Prequisite: When running this on newer machines (like anything Ubuntu >24.04), run:
export CFLAGS="-std=gnu11 -Wno-error=incompatible-pointer-types"export RUBY_CONFIGURE_OPTS="--disable-jit-support"before installing ruby / rbenv.
- Install Ruby and the required gems:
bundle install- Create and migrate the database:
rails db:create db:migrate-
Start Solr separately if required by your local setup.
-
Start the Rails server:
rails server- Open the application in your browser at
http://localhost:3000
The external text retrieval and snippet service settings are stored in config/text_service.yml. The default values are:
snippet_server_path- base URL for the external snippet servicesnippet_script- rendering script for snippet contentopenSeadragon_script- OpenSeadragon viewer script pathadl_hostport- host/port used when generating snippet URLsimage_server_prefix- base URL for image access in facsimile viewsfeedback_mail- feedback email addressexternal_prefix- external site prefix
Run the Rails test suite with:
rails test- The application uses the Blacklight library to build the search UI and Solr integration.
- User login is handled with Devise and Devise CAS authenticatable.
- The search interface is primarily configured in
app/controllers/catalog_controller.rb.
Update this section with your project license and legal terms.