Skip to content

Commit

Permalink
Index raw fixtures in test setup, get test passing
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadel committed May 5, 2023
1 parent 93890ef commit fbfac3b
Show file tree
Hide file tree
Showing 10 changed files with 373 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/pulsearch.rake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace :pulsearch do
desc 'Posts fixtures to Solr'
task :index do
solr = RSolr.connect url: Blacklight.connection_config[:url]
['spec/fixtures/alma', 'spec/fixtures/numismatics', 'spec/fixtures/scsb', 'spec/fixtures/theses_and_dissertations'].each do |dir|
['spec/fixtures/alma', 'spec/fixtures/raw'].each do |dir|
Dir["#{dir}/**/*.json"].each do |file_path|
doc = JSON.parse(File.read(file_path))
solr.add doc
Expand Down
4 changes: 1 addition & 3 deletions spec/fixtures/raw/99105816503506421.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,5 @@
],
"call_number_locator_display": [
"NA682.B7 S673 2017b"
],
"_version_": 1729485616939270144,
"timestamp": "2022-04-07T21:13:33.497Z"
]
}
123 changes: 122 additions & 1 deletion spec/fixtures/raw/9956562643506421.json
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
{"id":"9956562643506421","numeric_id_b":true,"author_display":["Lincoln, Mary S. G."],"author_citation_display":["Lincoln, Mary S. G."],"author_roles_1display":"{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Lincoln, Mary S. G.\"}","author_s":["Lincoln, Mary S. G."],"marc_relator_display":["Author"],"title_display":"Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln.","title_t":["Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln."],"title_citation_display":["Liverworts of New England : a guide for the amateur naturalist"],"compiled_created_t":["Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln."],"pub_created_display":["Bronx, New York : New York Botanical Garden Press, 2008."],"pub_created_s":["Bronx, New York : New York Botanical Garden Press, 2008."],"pub_citation_display":["Bronx, New York: New York Botanical Garden Press"],"pub_date_display":["2008"],"pub_date_start_sort":2008,"cataloged_tdt":"2021-07-13T12:40:07Z","format":["Book"],"description_display":["vi, 161 p. : ill. (chiefly col.), maps ; 26 cm."],"description_t":["vi, 161 p. : ill. (chiefly col.), maps ; 26 cm."],"number_of_pages_citation_display":["vi, 161 p."],"series_display":["Memoirs of the New York Botanical Garden ; v. 99.","Memoirs of the New York Botanical Garden ; v. 99"],"more_in_this_series_t":["Memoirs of the New York Botanical Garden"],"notes_display":["\"An introduction to the 195 species of liverworts (and four species of hornworts) in the six New England states.\"","\"Issued on 10 October 2008\"--Verso of t.p"],"bib_ref_notes_display":["Includes bibliographical references (p. 147-148) and index."],"language_facet":["English"],"language_code_s":["eng"],"language_iana_s":["en"],"lc_subject_display":["Liverworts—New England—Identification"],"subject_facet":["Liverworts—New England—Identification"],"isbn_display":["9780893274788","089327478X"],"isbn_s":["9780893274788"],"oclc_s":["277001579"],"other_version_s":["ocn277001579","9780893274788"],"holdings_1display":"{\"22700125400006421\":{\"location_code\":\"annex$stacks\",\"location\":\"Stacks\",\"library\":\"Forrestal Annex\",\"call_number\":\"QK556 .L56 2008\",\"call_number_browse\":\"QK556 .L56 2008\",\"items\":[{\"holding_id\":\"22700125400006421\",\"id\":\"23700125390006421\",\"status_at_load\":\"1\",\"barcode\":\"32101071926461\",\"copy_number\":\"1\"}]}}","location_code_s":["annex$stacks"],"location":["Forrestal Annex"],"location_display":["Stacks"],"advanced_location_s":["annex$stacks","Forrestal Annex"],"name_title_browse_s":["Lincoln, Mary S. G.. Liverworts of New England"],"call_number_display":["QK556 .L56 2008"],"call_number_browse_s":["QK556 .L56 2008"],"call_number_locator_display":["QK556 .L56 2008"],"_version_":1729219794801000448,"timestamp":"2022-04-04T22:48:25.588Z"}
{
"id": "9956562643506421",
"numeric_id_b": true,
"author_display": [
"Lincoln, Mary S. G."
],
"author_citation_display": [
"Lincoln, Mary S. G."
],
"author_roles_1display": "{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Lincoln, Mary S. G.\"}",
"author_s": [
"Lincoln, Mary S. G."
],
"marc_relator_display": [
"Author"
],
"title_display": "Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln.",
"title_t": [
"Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln."
],
"title_citation_display": [
"Liverworts of New England : a guide for the amateur naturalist"
],
"compiled_created_t": [
"Liverworts of New England : a guide for the amateur naturalist / Mary S.G. Lincoln."
],
"pub_created_display": [
"Bronx, New York : New York Botanical Garden Press, 2008."
],
"pub_created_s": [
"Bronx, New York : New York Botanical Garden Press, 2008."
],
"pub_citation_display": [
"Bronx, New York: New York Botanical Garden Press"
],
"pub_date_display": [
"2008"
],
"pub_date_start_sort": 2008,
"cataloged_tdt": "2021-07-13T12:40:07Z",
"format": [
"Book"
],
"description_display": [
"vi, 161 p. : ill. (chiefly col.), maps ; 26 cm."
],
"description_t": [
"vi, 161 p. : ill. (chiefly col.), maps ; 26 cm."
],
"number_of_pages_citation_display": [
"vi, 161 p."
],
"series_display": [
"Memoirs of the New York Botanical Garden ; v. 99.",
"Memoirs of the New York Botanical Garden ; v. 99"
],
"more_in_this_series_t": [
"Memoirs of the New York Botanical Garden"
],
"notes_display": [
"\"An introduction to the 195 species of liverworts (and four species of hornworts) in the six New England states.\"",
"\"Issued on 10 October 2008\"--Verso of t.p"
],
"bib_ref_notes_display": [
"Includes bibliographical references (p. 147-148) and index."
],
"language_facet": [
"English"
],
"language_code_s": [
"eng"
],
"language_iana_s": [
"en"
],
"lc_subject_display": [
"Liverworts—New England—Identification"
],
"subject_facet": [
"Liverworts—New England—Identification"
],
"isbn_display": [
"9780893274788",
"089327478X"
],
"isbn_s": [
"9780893274788"
],
"oclc_s": [
"277001579"
],
"other_version_s": [
"ocn277001579",
"9780893274788"
],
"holdings_1display": "{\"22700125400006421\":{\"location_code\":\"annex$stacks\",\"location\":\"Stacks\",\"library\":\"Forrestal Annex\",\"call_number\":\"QK556 .L56 2008\",\"call_number_browse\":\"QK556 .L56 2008\",\"items\":[{\"holding_id\":\"22700125400006421\",\"id\":\"23700125390006421\",\"status_at_load\":\"1\",\"barcode\":\"32101071926461\",\"copy_number\":\"1\"}]}}",
"location_code_s": [
"annex$stacks"
],
"location": [
"Forrestal Annex"
],
"location_display": [
"Stacks"
],
"advanced_location_s": [
"annex$stacks",
"Forrestal Annex"
],
"name_title_browse_s": [
"Lincoln, Mary S. G.. Liverworts of New England"
],
"call_number_display": [
"QK556 .L56 2008"
],
"call_number_browse_s": [
"QK556 .L56 2008"
],
"call_number_locator_display": [
"QK556 .L56 2008"
]
}
5 changes: 2 additions & 3 deletions spec/fixtures/raw/9960102253506421.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@
],
"call_number_locator_display": [
"TK7888.3 .V273 2007"
],
"hashed_id_ssi": "7fb50e49f9c2f7c1"
}
]
}
6 changes: 2 additions & 4 deletions spec/fixtures/raw/9991807103506421.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,5 @@
],
"call_number_locator_display": [
"HM886 .T69 2015"
],
"_version_": 1734566130355273700,
"timestamp": "2022-06-02T23:06:08.665Z"
}
]
}
113 changes: 112 additions & 1 deletion spec/fixtures/raw/scsb/SCSB-2635660.json
Original file line number Diff line number Diff line change
@@ -1 +1,112 @@
{"id":"SCSB-2635660","numeric_id_b":false,"other_id_s":["667075"],"author_display":["Saer, Juan José, 1937-2005"],"author_citation_display":["Saer, Juan José"],"author_roles_1display":"{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Saer, Juan José\"}","author_s":["Saer, Juan José, 1937-2005"],"marc_relator_display":["Author"],"title_display":"El entenado / Juan José Saer.","title_t":["El entenado / Juan José Saer."],"title_citation_display":["El entenado"],"compiled_created_t":["El entenado / Juan José Saer."],"edition_display":["1a edición."],"pub_created_display":["Barcelona : Destino, 1988."],"pub_created_s":["Barcelona : Destino, 1988."],"pub_citation_display":["Barcelona: Destino"],"pub_date_display":["1988"],"pub_date_start_sort":1988,"format":["Book"],"description_display":["200 pages ; 20 cm."],"description_t":["200 pages ; 20 cm."],"number_of_pages_citation_display":["200 pages"],"series_display":["Colección Ancora y delfín ; v. 617."],"more_in_this_series_t":["Colección Ancora y delfín"],"language_facet":["Spanish"],"language_code_s":["spa"],"language_iana_s":["es"],"isbn_display":["8423316327"],"isbn_s":["9788423316328"],"oclc_s":["18321158"],"other_version_s":["9788423316328","ocm18321158"],"holdings_1display":"{\"2613391\":{\"call_number\":\"PQ7797.S22435 E58 1988g\",\"call_number_browse\":\"PQ7797.S22435 E58 1988g\",\"location\":\"ReCAP\",\"library\":\"ReCAP\",\"location_code\":\"scsbcul\",\"items\":[{\"holding_id\":\"2613391\",\"id\":\"4163979\",\"status_at_load\":\"Unavailable\",\"barcode\":\"CU53020880\",\"copy_number\":\"1\",\"cgc\":\"Shared\",\"collection_code\":\"CU\"}]}}","recap_notes_display":["C - S"],"location_code_s":["scsbcul"],"location":["ReCAP"],"location_display":["ReCAP"],"advanced_location_s":["scsbcul","ReCAP"],"name_title_browse_s":["Saer, Juan José, 1937-2005. El entenado"],"call_number_display":["PQ7797.S22435 E58 1988g"],"call_number_browse_s":["PQ7797.S22435 E58 1988g"],"_version_":1683027317495955456,"timestamp":"2020-11-11T01:58:46.391Z"}
{
"id": "SCSB-2635660",
"numeric_id_b": false,
"other_id_s": [
"667075"
],
"author_display": [
"Saer, Juan José, 1937-2005"
],
"author_citation_display": [
"Saer, Juan José"
],
"author_roles_1display": "{\"secondary_authors\":[],\"translators\":[],\"editors\":[],\"compilers\":[],\"primary_author\":\"Saer, Juan José\"}",
"author_s": [
"Saer, Juan José, 1937-2005"
],
"marc_relator_display": [
"Author"
],
"title_display": "El entenado / Juan José Saer.",
"title_t": [
"El entenado / Juan José Saer."
],
"title_citation_display": [
"El entenado"
],
"compiled_created_t": [
"El entenado / Juan José Saer."
],
"edition_display": [
"1a edición."
],
"pub_created_display": [
"Barcelona : Destino, 1988."
],
"pub_created_s": [
"Barcelona : Destino, 1988."
],
"pub_citation_display": [
"Barcelona: Destino"
],
"pub_date_display": [
"1988"
],
"pub_date_start_sort": 1988,
"format": [
"Book"
],
"description_display": [
"200 pages ; 20 cm."
],
"description_t": [
"200 pages ; 20 cm."
],
"number_of_pages_citation_display": [
"200 pages"
],
"series_display": [
"Colección Ancora y delfín ; v. 617."
],
"more_in_this_series_t": [
"Colección Ancora y delfín"
],
"language_facet": [
"Spanish"
],
"language_code_s": [
"spa"
],
"language_iana_s": [
"es"
],
"isbn_display": [
"8423316327"
],
"isbn_s": [
"9788423316328"
],
"oclc_s": [
"18321158"
],
"other_version_s": [
"9788423316328",
"ocm18321158"
],
"holdings_1display": "{\"2613391\":{\"call_number\":\"PQ7797.S22435 E58 1988g\",\"call_number_browse\":\"PQ7797.S22435 E58 1988g\",\"location\":\"ReCAP\",\"library\":\"ReCAP\",\"location_code\":\"scsbcul\",\"items\":[{\"holding_id\":\"2613391\",\"id\":\"4163979\",\"status_at_load\":\"Unavailable\",\"barcode\":\"CU53020880\",\"copy_number\":\"1\",\"cgc\":\"Shared\",\"collection_code\":\"CU\"}]}}",
"recap_notes_display": [
"C - S"
],
"location_code_s": [
"scsbcul"
],
"location": [
"ReCAP"
],
"location_display": [
"ReCAP"
],
"advanced_location_s": [
"scsbcul",
"ReCAP"
],
"name_title_browse_s": [
"Saer, Juan José, 1937-2005. El entenado"
],
"call_number_display": [
"PQ7797.S22435 E58 1988g"
],
"call_number_browse_s": [
"PQ7797.S22435 E58 1988g"
]
}
70 changes: 69 additions & 1 deletion spec/fixtures/raw/theses_and_dissertations/dsp019c67wp402.json
Original file line number Diff line number Diff line change
@@ -1 +1,69 @@
{"id":"dsp019c67wp402","title_t":["Beaumains"],"title_citation_display":["Beaumains"],"title_display":"Beaumains","electronic_access_1display":"{\"http://arks.princeton.edu/ark:/88435/dsp019c67wp402\":[\"DataSpace\",\"Citation only\"]}","restrictions_note_display":["This thesis can be viewed in person at the \u003ca href=http://mudd.princeton.edu\u003eMudd Manuscript Library\u003c/a\u003e. \nTo order a copy complete the \u003ca href=\"http://rbsc.princeton.edu/senior-thesis-order-form\" target=\"_blank\"\u003eSenior Thesis Request Form\u003c/a\u003e. \nFor more information contact \u003ca href=mailto:mudd@princeton.edu\u003emudd@princeton.edu\u003c/a\u003e."],"call_number_display":["AC102 24981"],"call_number_browse_s":["AC102 24981"],"language_facet":["English"],"author_display":["Sobieski, Robert Yan"],"author_s":["Sobieski, Robert Yan","Anderson, Sarah","Sobel, Anne","Princeton University. Department of English"],"advisor_display":["Anderson, Sarah"],"contributor_display":["Sobel, Anne"],"department_display":["Princeton University. Department of English"],"description_display":["129 Pages"],"location":["Mudd Manuscript Library"],"location_display":["Mudd Manuscript Library"],"location_code_s":["mudd$stacks"],"advanced_location_s":["mudd$stacks","Mudd Manuscript Library"],"holdings_1display":"{\"thesis\":{\"location\":\"Mudd Manuscript Library\",\"library\":\"Mudd Manuscript Library\",\"location_code\":\"mudd$stacks\",\"call_number\":\"AC102 24981\",\"call_number_browse\":\"AC102 24981\",\"dspace\":true}}","class_year_s":["2010"],"pub_date_start_sort":2010,"pub_date_end_sort":2010,"format":["Senior thesis"],"hashed_id_s":["cec8fdbe71dfe3dd"],"_version_":1700362091038244864,"timestamp":"2021-05-21T10:07:17.671Z"}
{
"id": "dsp019c67wp402",
"title_t": [
"Beaumains"
],
"title_citation_display": [
"Beaumains"
],
"title_display": "Beaumains",
"electronic_access_1display": "{\"http://arks.princeton.edu/ark:/88435/dsp019c67wp402\":[\"DataSpace\",\"Citation only\"]}",
"restrictions_note_display": [
"This thesis can be viewed in person at the \u003ca href=http://mudd.princeton.edu\u003eMudd Manuscript Library\u003c/a\u003e. \nTo order a copy complete the \u003ca href=\"http://rbsc.princeton.edu/senior-thesis-order-form\" target=\"_blank\"\u003eSenior Thesis Request Form\u003c/a\u003e. \nFor more information contact \u003ca href=mailto:mudd@princeton.edu\u003emudd@princeton.edu\u003c/a\u003e."
],
"call_number_display": [
"AC102 24981"
],
"call_number_browse_s": [
"AC102 24981"
],
"language_facet": [
"English"
],
"author_display": [
"Sobieski, Robert Yan"
],
"author_s": [
"Sobieski, Robert Yan",
"Anderson, Sarah",
"Sobel, Anne",
"Princeton University. Department of English"
],
"advisor_display": [
"Anderson, Sarah"
],
"contributor_display": [
"Sobel, Anne"
],
"department_display": [
"Princeton University. Department of English"
],
"description_display": [
"129 Pages"
],
"location": [
"Mudd Manuscript Library"
],
"location_display": [
"Mudd Manuscript Library"
],
"location_code_s": [
"mudd$stacks"
],
"advanced_location_s": [
"mudd$stacks",
"Mudd Manuscript Library"
],
"holdings_1display": "{\"thesis\":{\"location\":\"Mudd Manuscript Library\",\"library\":\"Mudd Manuscript Library\",\"location_code\":\"mudd$stacks\",\"call_number\":\"AC102 24981\",\"call_number_browse\":\"AC102 24981\",\"dspace\":true}}",
"class_year_s": [
"2010"
],
"pub_date_start_sort": 2010,
"pub_date_end_sort": 2010,
"format": [
"Senior thesis"
],
"hashed_id_s": [
"cec8fdbe71dfe3dd"
]
}
Loading

0 comments on commit fbfac3b

Please sign in to comment.