atlas_rb 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a9ee4ab4b57221618d8ad13ab874acbfce61a452efc8e9562559fcb0215bef8
4
- data.tar.gz: 22c8c48404af609784177ba0f157380bc1cef435f9b6b37b76f6e65b95cef1a2
3
+ metadata.gz: a3d2bc949790f66ee7081de2e94d427f69869fcb301c45d4b9399c072f466820
4
+ data.tar.gz: 466abe63f27507e1845bc1126b739d2bfa396f7c79c447b1bf57e5be42352f4c
5
5
  SHA512:
6
- metadata.gz: 68ddbb93d8ad4049f16d01786d860f3ccc7bd610e5f57144f79ba0e30dd1bb8e66fd4c98adf17e9847b8551e9b42265b649650acd6c23f3a6dad3ffa3479879b
7
- data.tar.gz: bdfa9d364af363d50466158d13a944c3062b6d8649e5de57fdbb350d87e30e2c0fbf4dcc72c6ff515b536b40358456dc7359d449e1b2926149ff5f489f3ba9d5
6
+ metadata.gz: 87494a7060c9b9f192edb404ecffd98ea5b8f4859f4b507e25e7a8d66717d34af7c240f3d99df13163f5e822163d5d3f146df4e9898937a5cb0687b80d12cae1
7
+ data.tar.gz: 04b3221d9ae88ff6bd1b4586321dbd4eda20a4f6753cedfbf465ad4ad2d27214f5252a6e7dd4259e10a24b813eda4a966a7a39fd243244ad295b9c9a749cd5a6
data/.version CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.8.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.8.0
4
+
5
+ ### Added — `Work.set_full_text` (full-text search seam)
6
+
7
+ `Work.set_full_text(id, text:)` → `PATCH /works/:id/full_text`. Hands Atlas the
8
+ Work-level aggregate of Cerberus-extracted document text; Atlas stores it as the
9
+ Work's derived `full_text` and projects it onto the Work's Solr doc
10
+ (`all_text_timv`) for body-text search and the "Full Text Match" snippet. Same
11
+ "machine-set derived metadata" family as `set_thumbnails` / `set_image_derivatives`
12
+ — a regenerable search aid re-sent on any re-ingest, not user-authored content.
13
+
3
14
  ## 1.7.0
4
15
 
5
16
  ### Added — binary version read surface (`Blob.versions` / `version_content` / `rollback`)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.7.0)
4
+ atlas_rb (1.8.0)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
data/lib/atlas_rb/work.rb CHANGED
@@ -344,6 +344,42 @@ module AtlasRb
344
344
  ))
345
345
  end
346
346
 
347
+ # Store a Work's derived full-document text for search indexing.
348
+ #
349
+ # Purpose-specific PATCH in the same "machine-set derived metadata" family
350
+ # as {.set_thumbnails} / {.set_image_derivatives}. Hand Atlas the Work-level
351
+ # aggregate of the extracted body text (the concatenation of the Work's
352
+ # content FileSets' text); Atlas stores it as the Work's derived `full_text`
353
+ # and its `FullTextIndexer` projects it onto the Work's Solr doc
354
+ # (`all_text_timv`) for body-text search + the "Full Text Match" snippet.
355
+ #
356
+ # Distinct from {.metadata} — this is a machine-extracted search aid
357
+ # (pdftotext / Tika in a Cerberus job), not user-authored descriptive
358
+ # content, and is re-sent on any re-ingest. Empty/blank text clears it.
359
+ #
360
+ # @param id [String] the Work ID.
361
+ # @param text [String] the extracted plain text (Work-level aggregate).
362
+ # @param nuid [String, nil] optional acting user's NUID. On the relay-signing
363
+ # path it is signed into the assertion `sub`; on the BYO-JWT (`ATLAS_JWT`)
364
+ # path it is ignored (identity lives in the token).
365
+ # @param on_behalf_of [String, nil] optional NUID for the `On-Behalf-Of`
366
+ # header. Falls through to {AtlasRb.config}.default_on_behalf_of when
367
+ # omitted.
368
+ # @return [AtlasRb::Mash] the parsed JSON response (the Work; the stored text
369
+ # is not echoed back — it's read only through Solr).
370
+ # @raise [AtlasRb::StaleResourceError] if Atlas reports an optimistic-lock
371
+ # conflict that exhausted its internal retry budget (HTTP 409 with
372
+ # `error: "stale_resource"`).
373
+ #
374
+ # @example
375
+ # AtlasRb::Work.set_full_text("w-789", text: extracted_pdf_text)
376
+ def self.set_full_text(id, text:, nuid: nil, on_behalf_of: nil)
377
+ AtlasRb::Mash.new(JSON.parse(
378
+ connection({}, nuid, on_behalf_of: on_behalf_of)
379
+ .patch(ROUTE + id + '/full_text', JSON.dump(text: text))&.body
380
+ ))
381
+ end
382
+
347
383
  # List the assets attached to a Work — {Blob}s and {Delegate}s alike.
348
384
  #
349
385
  # Useful for building download UIs — the response includes enough to
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff