Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to index a record from Alma on demand #69

Open
mksndz opened this issue Aug 28, 2020 · 0 comments
Open

Ability to index a record from Alma on demand #69

mksndz opened this issue Aug 28, 2020 · 0 comments
Labels
question Further information is requested

Comments

@mksndz
Copy link
Member

mksndz commented Aug 28, 2020

Alma's webhooks can give us a stream of added, updated and removed BIB records. They are currently POSTed to https://franklin.library.upenn.edu/almahook, so we can handle it in a controller action/

Using this, we can trigger a record to be added/reindexed as soon as they are modified in Alma.

Alma's webhook JSON looks like:

{
  "id"=>"7120811384122420557", "action"=>"BIB",
  "institution"=>{"value"=>"01UPENN_INST", "desc"=>"University of Pennsylvania"},
  "time"=>"2020-08-17T15:03:25.393Z", "event"=> {"value"=>"BIB_CREATED", "desc"=>"BIB record created"},
  "bib"=>{
    "mms_id"=>"9977795539303681", "record_format"=>"marc21",
    "linked_record_id"=>{"value"=>"993390000000032320", "type"=>"CZ"},
    "title"=>"Stata Journal", "author"=>nil, "issn"=>nil, "isbn"=>nil,
    "network_number"=>["(CKB)3390000000032320", "(EXLCZ)993390000000032320"],
    "holdings"=>{"value"=>"", "link"=>"/almaws/v1/bibs/9977795539303681/holdings"},
    "created_by"=>"CKB", "created_date"=>"2013-05-25Z", "last_modified_by"=>"System",
    "last_modified_date"=>"2020-08-17Z", "suppress_from_publishing"=>"false",
    "suppress_from_external_search"=>"false", "sync_with_oclc"=>"NONE",
    "sync_with_libraries_australia"=>"NONE", "originating_system"=>"CKB",
    "originating_system_id"=>"(CKB)3390000000032320",
    "anies"=>["__THE_MARC_RECORD_AS_XML_I_THINK__"], "requests"=>nil, "link"=>nil
  },
  "holding"=>nil, "item"=>nil, "portfolio"=>nil, "representation"=>nil
}

This...might...just..contain everything we need to index (holdings, marc) but that needs more analysis (e.g., bound-withs?).

Thousands of these actions could occur each day, so a robust job queue is likely to be needed (e.g., Sidekiq). With Sidekiq, then we'd need a worker to perform the indexing.

Also, this will likely only supplement, not replace the existing indexing stuff. (Why? Say more)

@mksndz mksndz added the question Further information is requested label Aug 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant