Skip to content

Commit

Permalink
Separating datastores from search_options. Adding ids/values of `…
Browse files Browse the repository at this point in the history
…search_options` to `datastores`.
  • Loading branch information
erinesullivan committed Feb 20, 2025
1 parent a1d27db commit a8d12b5
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 182 deletions.
2 changes: 1 addition & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
session[:path_before_login] = request.url

S.logger.debug("here's the session", session.to_h)
@current_datastore = (datastores.find { |datastore| datastore[:slug] == subdirectory } || datastores.first)[:slug]
@current_datastore = datastores.find { |datastore| datastore[:slug] == subdirectory } || datastores.first
@datastores = datastores
end

Expand Down
233 changes: 81 additions & 152 deletions config/search_options.yaml
Original file line number Diff line number Diff line change
@@ -1,153 +1,82 @@
# This is the list of search options for the search bar at `views/datastores/partials/_search.erb`.
- group: Search by
options:
- datastores:
- everything
- catalog
- databases
- onlinejournals
- guidesandmore
text: Keyword
tip: Enter one or more keywords. Use quotes to search for a phrase (e.g., solar
power; polar bears; “systems of oppression”). See tips about
<a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">
Basic Keyword Searching</a>.
value: keyword
- datastores:
- articles
text: Keyword (contains)
tip: Enter one or more keywords to search broadly (e.g., Black Women Scientists).
Use quotes to search for a specific phrase (e.g., “systems of oppression”).
See tips about <a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">
Basic Keyword Searching</a>.
value: keyword
- datastores:
- articles
text: Keyword (is exact)
tip: Enter an exact phrase to search (e.g., solar power). Use AND to separate
concepts or phrases (e.g., Black Women Scientists AND Chanda Prescod). See tips
about <a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">
Basic Keyword Searching</a>.
value: exact
- datastores:
- everything
- catalog
- articles
- databases
- onlinejournals
- guidesandmore
text: Title
tip: Enter the first words in a title. Use quotes to search for a phrase (e.g.,
One Hundred Years of Solitude; “The Fourth World”; Disability Visibility).
value: title
- datastores:
- catalog
- databases
- onlinejournals
text: Title starts with
tip: Search for titles that begin with a word or phrase (e.g., introduction to
chemistry; history of Mexico; Asian art).
value: title_starts_with
- datastores:
- everything
- catalog
- articles
text: Author
tip: Search for items by author or contributor (e.g., Kimmerer, Robin Wall). Also
search organizations or corporate authors (e.g., American Medical Association).
Search for items by author using original scripts (e.g., 小川 洋子).
value: author
- datastores:
- catalog
text: Journal/Serial Title
tip: Search the title of a journal or serial publication (e.g., Detroit Free Press;
“journal of the american medical association”; African-American newspapers).
value: journal_title
- datastores:
- catalog
- articles
- onlinejournals
text: Subject
tip: Use words or phrases to search subjects (e.g., plant physiology, Baldwin,
James).
value: subject
- datastores:
- catalog
- onlinejournals
text: LC Subject starts with
tip: Enter words or phrases to see subjects that start with them (e.g., Baldwin,
James; sociology dictionaries).
value: lc_subject_starts_with
- datastores:
- databases
- onlinejournals
text: Academic Discipline
tip: Search academic disciplines (e.g., International business; Latin american
and caribbean studies). <a href="/databases/browse">Browse all Databases</a>
alphabetically or by academic discipline.
value: academic_discipline
- datastores:
- databases
text: Publisher
tip: Search names of publishers of databases.
value: publisher
- datastores:
- catalog
- onlinejournals
text: Call Number starts with
tip: Search the first few letters and numbers of a call number (e.g., RC662.4
.H38 2016; QH 105). <a href="https://www.loc.gov/catdir/cpso/lcco/?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Learn about the meaning of call numbers - opens in new window">
Learn about the meaning of call numbers</a>.
value: call_number_starts_with
- datastores:
- catalog
text: Series (transcribed)
tip: Search the series title of a group of thematically-related books. Use &lsquo;title&rsquo;
search to find unique titles within a series (e.g., Politics of Race and Ethnicity,
Brill&apos;s Annotated Bibliographies, Oxford Choral Music).
value: series
- datastores:
- articles
text: Date
tip: Search by year (YYYY) (e.g., 2021; 1942).
value: publication_date
- datastores:
- catalog
- onlinejournals
text: ISBN/ISSN/OCLC/etc
tip: Search by ISSN (8-digit code), ISBN (13 or 10-digit code), or OCLC number
(e.g., 0040-781X; 0747581088; 921446069).
value: isn
- datastores:
- articles
text: ISSN
tip: Search by ISSN (8-digit code) (e.g., 0040-781X).
value: issn
- datastores:
- articles
text: ISBN
tip: Search by ISBN (13 or 10-digit code) (e.g., 0747581088).
value: isbn
- group: Browse by
options:
- datastores:
- catalog
text: Browse by call number (LC and Dewey)
tip: Browse by Library of Congress (LC) or Dewey call number, sorted alphanumerically
(e.g., RC662.4 .H38 2016; QH 105, 880 J375re).
<a href="https://www.loc.gov/catdir/cpso/lcco/?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Learn about the meaning of call numbers - opens in new window">
Learn about the meaning of call numbers</a>.
value: browse_by_callnumber
- datastores:
- catalog
text: Browse by author
tip: Browse an alphabetical list of authors. Authors can be people (put last names
first), organizations, or events (e.g., Kingston, Maxine Hong; United Nations
Development Programme; Pong, Chun-ho).
value: browse_by_author
- datastores:
- catalog
text: Browse by subject
tip: Browse an A-Z list of subjects (e.g., motion pictures; history--United States;
Eliot, George).
value: browse_by_subject
- value: academic_discipline
text: Academic Discipline
tip: Search academic disciplines (e.g., International business; Latin american and caribbean studies). <a href="/databases/browse">Browse all Databases</a> alphabetically or by academic discipline.
group: search
- value: author
text: Author
tip: Search for items by author or contributor (e.g., Kimmerer, Robin Wall). Also search organizations or corporate authors (e.g., American Medical Association). Search for items by author using original scripts (e.g., 小川 洋子).
group: search
- value: browse_by_author
text: Browse by author
tip: Browse an alphabetical list of authors. Authors can be people (put last names first), organizations, or events (e.g., Kingston, Maxine Hong; United Nations Development Programme; Pong, Chun-ho).
group: browse
- value: browse_by_callnumber
text: Browse by call number (LC and Dewey)
tip: Browse by Library of Congress (LC) or Dewey call number, sorted alphanumerically (e.g., RC662.4 .H38 2016; QH 105, 880 J375re). <a href="https://www.loc.gov/catdir/cpso/lcco/?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Learn about the meaning of call numbers - opens in new window">Learn about the meaning of call numbers</a>.
group: browse
- value: browse_by_subject
text: Browse by subject
tip: Browse an A-Z list of subjects (e.g., motion pictures; history--United States; Eliot, George).
group: browse
- value: call_number_starts_with
text: Call Number starts with
tip: Search the first few letters and numbers of a call number (e.g., RC662.4.H38 2016; QH 105). <a href="https://www.loc.gov/catdir/cpso/lcco/?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Learn about the meaning of call numbers - opens in new window">Learn about the meaning of call numbers</a>.
group: search
- value: exact
text: Keyword (is exact)
tip: Enter an exact phrase to search (e.g., solar power). Use AND to separate concepts or phrases (e.g., Black Women Scientists AND Chanda Prescod). See tips about <a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">Basic Keyword Searching</a>.
group: search
- value: isbn
text: ISBN
tip: Search by ISBN (13 or 10-digit code) (e.g., 0747581088).
group: search
- value: isn
text: ISBN/ISSN/OCLC/etc
tip: Search by ISSN (8-digit code), ISBN (13 or 10-digit code), or OCLC number (e.g., 0040-781X; 0747581088; 921446069).
group: search
- value: issn
text: ISSN
tip: Search by ISSN (8-digit code) (e.g., 0040-781X).
group: search
- value: journal_title
text: Journal/Serial Title
tip: Search the title of a journal or serial publication (e.g., Detroit Free Press; “journal of the american medical association”; African-American newspapers).
group: search
- value: keyword
text: Keyword
tip: Enter one or more keywords. Use quotes to search for a phrase (e.g., solar power; polar bears; “systems of oppression”). See tips about <a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">Basic Keyword Searching</a>.
group: search
- id: keyword_contains
value: keyword
text: Keyword (contains)
tip: Enter one or more keywords to search broadly (e.g., Black Women Scientists). Use quotes to search for a specific phrase (e.g., “systems of oppression”). See tips about <a href="https://guides.lib.umich.edu/c.php?g=914690&p=6590011?utm_source=library-search" class="open-in-new" target="_blank" rel="noopener noreferrer" aria-label="Basic Keyword Searching - opens in new window">Basic Keyword Searching</a>.
group: search
- value: lc_subject_starts_with
text: LC Subject starts with
tip: Enter words or phrases to see subjects that start with them (e.g., Baldwin, James; sociology dictionaries).
group: search
- value: publication_date
text: Date
tip: Search by year (YYYY) (e.g., 2021; 1942).
group: search
- value: publisher
text: Publisher
tip: Search names of publishers of databases.
group: search
- value: series
text: Series (transcribed)
tip: Search the series title of a group of thematically-related books. Use "title"; search to find unique titles within a series (e.g., Politics of Race and Ethnicity, Brill's Annotated Bibliographies, Oxford Choral Music).
group: search
- value: subject
text: Subject
tip: Use words or phrases to search subjects (e.g., plant physiology, Baldwin, James).
group: search
- value: title
text: Title
tip: Enter the first words in a title. Use quotes to search for a phrase (e.g., One Hundred Years of Solitude; “The Fourth World”; Disability Visibility).
group: search
- value: title_starts_with
text: Title starts with
tip: Search for titles that begin with a word or phrase (e.g., introduction to chemistry; history of Mexico; Asian art).
group: search
63 changes: 57 additions & 6 deletions lib/search/presenters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,83 @@ def self.datastores
{
description: "Explore the University of Michigan Library Search for comprehensive results across catalogs, articles, databases, online journals, and more. Begin your search now for detailed records and specific resources.",
slug: "everything",
title: "Everything"
title: "Everything",
search_options: [
"keyword",
"title",
"author"
]
},
{
description: "Discover the University of Michigan Library Catalog to access an extensive collection of physical and online materials, including books, audio, video, maps, musical scores, and more. Find everything you need in one place.",
slug: "catalog",
title: "Catalog"
title: "Catalog",
search_options: [
"keyword",
"title",
"title_starts_with",
"author",
"journal_title",
"subject",
"lc_subject_starts_with",
"call_number_starts_with",
"series",
"isn",
"browse_by_callnumber",
"browse_by_author",
"browse_by_subject"
]
},
{
description: "Utilize the Articles gateway at the University of Michigan Library to access scholarly journal articles, newspaper articles, book chapters, and conference proceedings. For subject-specific searches, explore our comprehensive databases.",
slug: "articles",
title: "Articles"
title: "Articles",
search_options: [
"keyword_contains",
"exact",
"title",
"author",
"subject",
"publication_date",
"issn",
"isbn"
]
},
{
description: "Explore University of Michigan Library's databases, tailored to specific subjects and formats. Access subscription databases, locally created collections, and open-access resources. Browse by alphabetical order or academic discipline to find what you need.",
slug: "databases",
title: "Databases"
title: "Databases",
search_options: [
"keyword",
"title",
"title_starts_with",
"academic_discipline",
"publisher"
]
},
{
description: "Access University of Michigan Library's Online Journals, including scholarly journals, newspapers, trade publications, and magazines. Find subscription and open-access journals, with detailed access and date information. Browse by title or discipline.",
slug: "onlinejournals",
title: "Online Journals"
title: "Online Journals",
search_options: [
"keyword",
"title",
"title_starts_with",
"subject",
"lc_subject_starts_with",
"academic_discipline",
"call_number_starts_with",
"isn"
]
},
{
description: "Discover University of Michigan Library's Guides and More section for research guides, specialty sites, blogs, and online exhibits. Explore services, spaces, and collections, and visit lib.umich.edu for staff info, news, events, and physical exhibits.",
slug: "guidesandmore",
title: "Guides and More"
title: "Guides and More",
search_options: [
"keyword",
"title"
]
}
]
end
Expand Down
Loading

0 comments on commit a8d12b5

Please sign in to comment.