diff --git a/.ruby-version b/.ruby-version index f6ab44e..4e34c4d 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.6.6 +ruby-2.7.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 101c767..3f6671c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,16 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Contributors --> +## [v1.0.4](https://github.com/CDRH/api/compare/v1.0.3...v1.0.4) - Updates & license + +### Changed +- Updated Ruby version, gems (which addresses mimemagic dependency problem), and Puma +- added license + +### Added + +- Documentation on facets and highlighting + ## [v1.0.3](https://github.com/CDRH/api/compare/v1.0.2...v1.0.3) - gem updates ### Changed diff --git a/Gemfile b/Gemfile index 17883e5..3e78e07 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ gem 'rails', '~> 5.2.0' # Use sqlite3 as the database for Active Record gem 'sqlite3' # Use Puma as the app server -gem 'puma', '~> 3.7' +gem 'puma', '>= 5.6' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder # gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production diff --git a/Gemfile.lock b/Gemfile.lock index 5bc37ac..3cfe13c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,119 +1,120 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.4.4) - actionpack (= 5.2.4.4) + actioncable (5.2.8) + actionpack (= 5.2.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) + actionmailer (5.2.8) + actionpack (= 5.2.8) + actionview (= 5.2.8) + activejob (= 5.2.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.4.4) - actionview (= 5.2.4.4) - activesupport (= 5.2.4.4) + actionpack (5.2.8) + actionview (= 5.2.8) + activesupport (= 5.2.8) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.4.4) - activesupport (= 5.2.4.4) + actionview (5.2.8) + activesupport (= 5.2.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.4.4) - activesupport (= 5.2.4.4) + activejob (5.2.8) + activesupport (= 5.2.8) globalid (>= 0.3.6) - activemodel (5.2.4.4) - activesupport (= 5.2.4.4) - activerecord (5.2.4.4) - activemodel (= 5.2.4.4) - activesupport (= 5.2.4.4) + activemodel (5.2.8) + activesupport (= 5.2.8) + activerecord (5.2.8) + activemodel (= 5.2.8) + activesupport (= 5.2.8) arel (>= 9.0) - activestorage (5.2.4.4) - actionpack (= 5.2.4.4) - activerecord (= 5.2.4.4) - marcel (~> 0.3.1) - activesupport (5.2.4.4) + activestorage (5.2.8) + actionpack (= 5.2.8) + activerecord (= 5.2.8) + marcel (~> 1.0.0) + activesupport (5.2.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) arel (9.0.0) - bootsnap (1.5.1) - msgpack (~> 1.0) + bootsnap (1.11.1) + msgpack (~> 1.2) builder (3.2.4) byebug (11.1.3) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.10) crass (1.0.6) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - erubi (1.9.0) - ffi (1.13.1) - globalid (0.4.2) - activesupport (>= 4.2.0) + erubi (1.10.0) + ffi (1.15.5) + globalid (1.0.0) + activesupport (>= 5.0) http-accept (1.7.0) - http-cookie (1.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) - i18n (1.8.5) + i18n (1.10.0) concurrent-ruby (~> 1.0) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - loofah (2.7.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) + marcel (1.0.2) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2020.1104) - mimemagic (0.3.5) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - msgpack (1.3.3) + mime-types-data (3.2022.0105) + mini_mime (1.1.2) + mini_portile2 (2.8.0) + minitest (5.15.0) + msgpack (1.5.1) netrc (0.11.0) - nio4r (2.5.4) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - puma (3.12.6) + nio4r (2.5.8) + nokogiri (1.13.6) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + puma (5.6.4) + nio4r (~> 2.0) + racc (1.6.0) rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.4.4) - actioncable (= 5.2.4.4) - actionmailer (= 5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) - activemodel (= 5.2.4.4) - activerecord (= 5.2.4.4) - activestorage (= 5.2.4.4) - activesupport (= 5.2.4.4) + rails (5.2.8) + actioncable (= 5.2.8) + actionmailer (= 5.2.8) + actionpack (= 5.2.8) + actionview (= 5.2.8) + activejob (= 5.2.8) + activemodel (= 5.2.8) + activerecord (= 5.2.8) + activestorage (= 5.2.8) + activesupport (= 5.2.8) bundler (>= 1.3.0) - railties (= 5.2.4.4) + railties (= 5.2.8) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (5.2.4.4) - actionpack (= 5.2.4.4) - activesupport (= 5.2.4.4) + railties (5.2.8) + actionpack (= 5.2.8) + activesupport (= 5.2.8) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) - rake (13.0.1) - rb-fsevent (0.10.4) + rake (13.0.6) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) rest-client (2.1.0) @@ -126,22 +127,22 @@ GEM spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (4.0.2) + sprockets (4.0.3) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.2) - thor (1.0.1) + thor (1.2.1) thread_safe (0.3.6) - tzinfo (1.2.8) + tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.7.7) - websocket-driver (0.7.3) + unf_ext (0.0.8.1) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -152,7 +153,7 @@ DEPENDENCIES bootsnap byebug listen (>= 3.0.5, < 3.2) - puma (~> 3.7) + puma (>= 5.6) rails (~> 5.2.0) rest-client (>= 2.1.0.rc1, < 2.2) spring @@ -161,4 +162,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 2.1.4 + 2.2.26 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..922ddb3 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,20 @@ +Copyright 2021 Center for Digital Research in the Humanities, University of Nebraska-Lincoln + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index bfa29a5..94cb16b 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ Apium is an API to access all public Center for Digital Research in the Humanities resources. It is also an invasive weed in Nebraska. **[Apium Documentation](docs/README.md)** + +This project is licensed under the terms of the [MIT license](LICENSE.md). diff --git a/config/initializers/version.rb b/config/initializers/version.rb index c06ea3b..b17ba8e 100644 --- a/config/initializers/version.rb +++ b/config/initializers/version.rb @@ -1,5 +1,5 @@ module Api class Application < Rails::Application - VERSION = "1.0.3" + VERSION = "1.0.4" end end diff --git a/docs/README.md b/docs/README.md index 026368f..8aa9ad6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,6 +2,19 @@ Apium is an API to access all public Center for Digital Research in the Humanities resources. It is also an invasive weed in Nebraska. +## Overview + +The CDRH has the metadata and text of several thousand documents such as letters, posters, novels, and images in an Elasticsearch index. This API is a wrapper around that index which provides convenient ways to search and filter those items. + +Below, you can find instructions about basic functionality like [sorting](#sorting), [pagination](#start-and-rows) (start / rows), and selecting the [fields you want to get back](#field-list). + +There are a couple features that may need a little bit of an introduction. + +__Facets__ provide you a way of combining and counting the values of a field related to a query. For example, if you search for "horse" and get 100 results, a facet on the author name field might tell you that 90 of those results were by Buffalo Bill, 9 from Meriwether Lewis, and 1 from Jane Austen. You can add facets on keyword fields and date fields, but not on text fields. + +__Highlights__ are a cool way to preview the results of a text query. For example, if you searched for "horse," highlights might look like "...Oglala Sioux Nation. American Horse was the son of Sitting Bear..." and "...Stout as a horse, affectionate, haughty, electrical..." This preview helps users decide which result is most relevant to them. You can add highlighting to any text field. + + ## item query - [Facets](#facets)