Tiny Solr Library

Created by Bernardo Gomez

Updated May 2025

Agenda

This presentation will describe the steps to implement a Solr front-end for MARC records.

Implementation Steps

1. Installing Solr (9.8.1 , for instance)

2. Learning Solr from a bundled example.

3. Creating a Solr core for the Tiny Library

Installing Solr

(As an initial development environment)

Installing initial development environment

  • 5. Run bundled example: solr-9.8.1/bin/solr -e techproducts
  • 6. Run Solr Admin UI: http://localhost:8983/solr

Creating a Solr core for Tiny Library

  • 1. Replicate configsets/sample_techproducts_configs/conf directory as mycore/conf/
  • 2. Modify solrconfig.xml , stopwords.txt
  • 3. Modify managed-schema via API calls

Creating a Solr core for Tiny Library

  • 4. Create input file with MARC records.
  • 5. Give the core a name: "euclid"
  • 6. Run solr-9.8.1/bin/solr create_core -c euclid -d mycore/conf/

Input file (1 record)

			
<add>
<doc>
<field name="id">990007175530302486</field>
<field name="title">The complete Miles Davis at Montreux  </field>
<field name="creator">Davis, Miles.</field>
<field name="author">Davis Miles</field>
<field name="subject">Live sound recordings</field>
<field name="subject">Jazz musicians</field>
<field name="subject">Jazz</field>
<field name="subject">Jazz vocals</field>
<field name="pubDate">2002</field>
<field name="topic">Live sound recordings</field>
<field name="topic">Jazz musicians</field>
<field name="topic">Jazz</field>
<field name="topic">Jazz vocals</field>
<field name="language">English</field>
<field name="resourceType">Sound recording</field>
<field name="loc_authority_name">n50035608</field>
<field name="wikidata_id">Q93341</field>
<field name="record">=LDR  ^^^^^cjm^a2200577Ia^4500
=001  990007175530302486
=005  20160418211004.0
=007  sd^fungnn|||eu
=008  021212p20021973xxujzn^^^i^^^^^^^^^^eng^d
=024  1\$a696998682429
=028  02$a9699-86824-2$bColumbia/Legacy
=028  00$a9362-45221-2$bWarner Bros.
=028  00$a9 45221-2$bWarner Bros.
=033  00$a19730708$b6044$cM6
=033  20$a19840708$a19910708$b6044$cM6
=033  00$a19910717$b5834$cN5
=035  \\$a(Aleph)000717553EMU01
=035  9\$au2955438
=035  \\$aocm51214070
=035  \\$a(Sirsi) o51214070
=035  \\$a(OCoLC)51214070
=040  \\$aIXA$cIXA$dMDY$dOCLCQ$dUtOrBLW
=082  04$a781.65
=100  1\$aDavis, Miles.
=245  14$aThe complete Miles Davis at Montreux /$cMiles.
=246  30$aMiles Davis at Montreux
=264  \4$c℗2002
=264  \1$a[U.S.?] :$bColumbia/Legacy :$bMontreux Sounds,$c[2002]
=300  \\$a20 sound discs :$bdigital ;$c4 3/4 in.
=336  \\$aperformed music$bprm$2rdacontent
=337  \\$aaudio$bs$2rdamedia
=338  \\$aaudio disc$bsd$2rdacarrier
=500  \\$a"Contain[s] every single note that ... Miles Davis played at the Montreux Jazz Festival on Lake Geneva in Switzerland"--P. 6 of book.
=511  0\$aMiles Davis, trumpet ; with, variously: Dave Liebman, reeds ; Kenny Garrett, Rick Margitza, David Sanborn, saxophone ; Bob Berg, saxophone, keyboards ; Reggie Lucas, Pete Cosey, John Scofield, Robben Ford, guitar ; Robert Irving III, Adam Holzman, Kei Akagi, Deron Johnson, George Duke, keyboards ; Michael Henderson, Darryl Jones, Felton Crews, Benny Rietveld, bass ; Richard Patterson, Foley, bass, vocal ; Al Foster, Vincent Wilburn Jr., Ricky Wellman, drums ; J. Mtume, percussion, synthesizer ; Steve Thornton, Marilyn Mazur, Munyungo Jackson, Erin Davis, percussion ; Wallace Roney, trumpet, flugelhorn ; Chaka Khan, vocal ; The Gil Evans Orchestra ; The George Gruntz Concert Jazz Band ; Quincy Jones, conductor.
=518  \\$aRecorded live at the Montreux Jazz Festival, Montreux, Switzerland, July 8, 1973 and July 8, 1984-July 8, 1991; disc 20 recorded live in Nice, France, July 17, 1991.
=500  \\$aMost selections previously unreleased; disc 19 previously released as Live at Montreux in 1993 (Warner Bros. 9362-45221-2 [i.e. 9 45221-2]).
=500  \\$aCompact discs.
=500  \\$aProgram notes by Nick Liebmann, Claude Nobs, and Adam Holzman (49 p. : ill., some col. ; 27 x 16 cm.) inserted in container.
=505  0\$aVariously (some titles repeated): Miles in Montreux '73 -- Ife -- Calypso frelimo -- Speak/That's what happened -- Star people -- What it is -- It gets better -- Something's on your mind -- Time after time -- Hopscotch/Star on Cicely -- Bass solo -- Jean-Pierre -- Lake Geneva -- Code M.D. -- Theme from Jack Johnson/One phone call/Street scenes/That's what happened -- Maze -- Human nature -- MD 1/Something's on your mind/MD 2 -- Ms. Morrisine -- Pacific Express -- Katia -- You're under arrest -- Jean-Pierre/You're under arrest/Then there were none -- Decoy -- New blues -- Wrinkle -- Tutu -- Splatch -- Al Jarreau -- Carnival time -- Burn -- Portia -- In a silent way -- Intruder -- Perfect way -- The senate/Me & U -- Movie star -- Heavy metal prelude -- Heavy metal -- Don't stop me now -- Tomaas -- Hannibal -- Mr. Pastorius -- Jilli -- Jo Jo -- Amandla -- Introduction by Claude Nobs & Quincy Jones -- Boplicity -- Introduction to "Miles ahead" medley -- Springsville -- Maids of Cadiz -- The Duke -- My ship -- Miles ahead -- Blues for Pablo -- Introduction to "Porgy and Bess" medley -- Orgone -- Gone, gone, gone -- Summertime -- Here come de honey man -- Introduction to "Sketches of Spain" -- The pan piper -- Solea.
=650  \0$aJazz.
=650  \0$aJazz vocals.
=650  \0$aJazz musicians.
=650  \0$aJazz musicians$zUnited States.
=650  \0$aLive sound recordings.
=710  2\$aMontreux Sounds.
=740  02$aLive at Montreux.
=910  \\$aRDA ENRICHED
=910  \\$aMARS
=945  \\$aemu pmb
=945  \\$a9DT$220080225
=994  \\$aZ0$bEMU
=999  \\$aCD 17067$bavailable$d$e23169348740002486$f$i010001311400$lMEDIAOSIZE$mMUSME$p18$tCD$w4
</field>
</doc>
</add>
		
		

MARC to SOLR field mapping

MARC SOLR
100|a creator
245|a title
\1 264|c pubDate
\\ 260|c (if "\1 264|c" doesn't exist) pubDate
1\ 100|a author (advanced search)
1\ 100|a creator (normalized string)

MARC to SOLR mapping (continued)

MARC SOLR
700|a contributor (normalized string)
650|a genre (normalized string)
008 (position 35-37) language

Solr command to load input file.

		
#!/bin/sh
cd $HOME/mysolr/solr.9.8.1/bin
./post -c euclid -filetypes xml $HOME/mysolr/solr-9.8.1/server/solr/userfiles/euclid/euclid_example.xml
		
		

Some Solr API calls to change the schema(editing the managed-schema file)

delete-copy-field

		
curl -X POST -H 'Content-type:application/json' --data-binary '{
  "delete-copy-field":{ "source":"features", "dest":"text" }
}' http://localhost:8983/solr/euclid/schema
		
		

Some Solr API calls to change the schema(editing the managed-schema file)

delete-field

		
curl -X POST -H 'Content-type:application/json' --data-binary '{
 "delete-field" : { "name":"pre"}
}' http://localhost:8983/solr/euclid/schema
		
		

Some Solr API calls to change the schema(editing the managed-schema file)

add-copy-field

		
curl -X POST -H 'Content-type:application/json' --data-binary '{
  "add-copy-field":{
     "source":"title",
     "dest": "text"}
}' http://localhost:8983/solr/euclid/schema
		
		

Some Solr API calls to change the schema(editing the managed-schema file)

add-field

		
curl -X POST -H 'Content-type:application/json' --data-binary '{
  "add-field":{
     "name":"author",
     "type":"text_general",
     "indexed": true,
     "stored": false,
     "multiValued" : true}
}' http://localhost:8983/solr/euclid/schema
		
		

Solr API call to search records

		
http://localhost:8983/solr/euclid/select?q=miles%20davis
		
		

Solr API call to request spell checking

		
http://localhost:8983/solr/euclid/spell?spellcheck.q=miles%20daviss&spellcheck=on
		
		

Demonstration site:

Solrtinylib.info

Thanks!