User Tools

Site Tools


zzz_archive:dev:proposal:additional_search_languages

Note: an equivalent feature, Multilingual Search, was introduced in Evergreen 3.1.

Basic overview of the feature or change

Proposed feature is to add capability for additional search target languages to be specified.
Currently, Evergreen only allows the language specified in MARC 008 position 35-37 to be the target of a language search.
There is no current mechanism to allow for additional languages to be included as search targets.
The proposed change would add a new table (metabib.language_filter e.g.). This new table would contain a tsvector datatype.
This tsvector would contain the languages associated with each bib record (tag 008 35-37 and selected 041 records).
Search code would be changed to join the metabib.language_filter table during the search query build.

An explanation of the existing code – it's structure and purpose – if applicable

An explanation of why this code needs to change, if applicable

These changes will allow an additional MARC tag (041) and subfields to be searched for language, beyond the standard tag 008 position 35-37.

A full explanation of the new or replacement feature including implementation plans

This feature will allow staff to search for alternate languages, in addition to the primary language found in MARC 008 field position 35-37.
An additional table, metabib.language_filter, would be added. This table would include a tsvector, which contains a vector of languages associated with
a bib record. These languages could be searched by staff using the language pulldown, or the "item_lang" search line command. If no languages were
selected in the language pulldown, there would be no change to current search; the "default" language would be used in searching.

Analysis of what this change will effect in the existing code base

The following perl module would be modified:

  • ./Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

Code would be added to include a join on the metabib:language_filter, so that the search languages would be included in the SQL search query.

Additional records added to the database:

A new table, metabib.language_filter, would be added to the schema. The columns of the table would be:

  • id (primary key)
  • source (foreign key to biblio.record_entry.id)
  • value (tsvector containing 008 (35-37) and 041 subfield values containing languages associated with the selected bib record.

The language_filter table would be populated via a sql script, extracting 008 (35-37) and 041 subfields from the biblio.record_entry marc field.

A new trigger would be added:

  • biblio.record_entry.language_filter_trigger

A new trigger procedure would be added for biblio.record_entry.language_filter_trigger:

  • biblio.record_entry.update_language_filter

A new row would be added to config.org_unit_setting_type. This would allow the MARC 041 subfield(s) to be set via the Library Settings editor of Local Administration. The value in the org_unit_setting_type would be an array containing the specified subfield.

Analysis of what ways, if any, this addition or change can be leveraged for future planned development

zzz_archive/dev/proposal/additional_search_languages.txt · Last modified: 2022/02/10 13:34 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.