Bug 33277: Add comments and missing thesauri
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
be0241ea69
commit
5d0050d84d
4 changed files with 22 additions and 6 deletions
|
@ -202,6 +202,8 @@ sub _search {
|
||||||
my @operator;
|
my @operator;
|
||||||
my @value;
|
my @value;
|
||||||
|
|
||||||
|
# FIXME: We specify values for @and_or and @excluding
|
||||||
|
# but these fields are not used anywhere and should be removed
|
||||||
if ($index) {
|
if ($index) {
|
||||||
push @marclist, $index;
|
push @marclist, $index;
|
||||||
push @and_or, 'AND';
|
push @and_or, 'AND';
|
||||||
|
|
|
@ -359,6 +359,11 @@ sub _get_subject_thesaurus {
|
||||||
my $field = shift;
|
my $field = shift;
|
||||||
my $ind2 = $field->indicator(2);
|
my $ind2 = $field->indicator(2);
|
||||||
|
|
||||||
|
# NOTE: sears and aat do not appear
|
||||||
|
# here as they do not have indicator values
|
||||||
|
# though the 008 in the authority records
|
||||||
|
# do have values for them
|
||||||
|
|
||||||
my $thesaurus = "notdefined";
|
my $thesaurus = "notdefined";
|
||||||
if ( $ind2 eq '0' ) {
|
if ( $ind2 eq '0' ) {
|
||||||
$thesaurus = "lcsh";
|
$thesaurus = "lcsh";
|
||||||
|
|
|
@ -564,6 +564,10 @@ our $koha_to_index_name = {
|
||||||
all => ''
|
all => ''
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Note that sears and aat map to 008/11 values here
|
||||||
|
# but don't appear in C4/Headin/MARC21 thesaurus
|
||||||
|
# because they don't have values in controlled field indicators
|
||||||
|
# https://www.loc.gov/marc/authority/ad008.html
|
||||||
our $thesaurus_to_value = {
|
our $thesaurus_to_value = {
|
||||||
lcsh => 'a',
|
lcsh => 'a',
|
||||||
lcac => 'b',
|
lcac => 'b',
|
||||||
|
@ -572,6 +576,8 @@ our $thesaurus_to_value = {
|
||||||
notspecified => 'n',
|
notspecified => 'n',
|
||||||
cash => 'k',
|
cash => 'k',
|
||||||
rvm => 'v',
|
rvm => 'v',
|
||||||
|
aat => 'r',
|
||||||
|
sears => 's'
|
||||||
};
|
};
|
||||||
|
|
||||||
sub build_authorities_query_compat {
|
sub build_authorities_query_compat {
|
||||||
|
|
|
@ -69,6 +69,9 @@ subtest "_search tests" => sub {
|
||||||
|
|
||||||
t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
|
t::lib::Mocks::mock_preference('marcflavour', 'MARC21');
|
||||||
t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch');
|
t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch');
|
||||||
|
# NOTE: We are testing solely against ES here to make the assumptions simpler while testing
|
||||||
|
# C4/Headings code specifically. The actual query building and searching code should
|
||||||
|
# be covered in other test files
|
||||||
my $search = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::Search');
|
my $search = Test::MockModule->new('Koha::SearchEngine::Elasticsearch::Search');
|
||||||
|
|
||||||
$search->mock('search_auth_compat', sub {
|
$search->mock('search_auth_compat', sub {
|
||||||
|
|
Loading…
Reference in a new issue