Browse Source

Bug 19575: Keep authority-number as alias and fix query

Keep authority-number as alias and change field name
from alias to real field in hard coded Elasticsearch query

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
David Gustafsson 2 years ago
committed by root
parent
commit
eeda2afd3a
  1. 1
      Koha/SearchEngine/Elasticsearch/QueryBuilder.pm
  2. 2
      Koha/SearchEngine/Elasticsearch/Search.pm
  3. 2
      installer/data/mysql/atomicupdate/bug_19575-use-canonical-field-names-and-resolve-aliased-fields.sql

1
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm

@ -557,6 +557,7 @@ our %index_field_convert = (
'se' => 'title-series',
'ut' => 'title-uniform',
'an' => 'koha-auth-number',
'authority-number' => 'koha-auth-number',
'at' => 'authtype',
'he' => 'heading',
'rank' => 'relevance',

2
Koha/SearchEngine/Elasticsearch/Search.pm

@ -266,7 +266,7 @@ sub count_auth_use {
query => {
bool => {
# query => { match_all => {} },
filter => { term => { 'authority-number' => $authid } }
filter => { term => { 'koha-auth-number' => $authid } }
}
}
};

2
installer/data/mysql/atomicupdate/bug_19575-use-canonical-field-names-and-resolve-aliased-fields.sql

@ -7,7 +7,7 @@ UPDATE `search_field` SET `name` = 'control-number', `label` = 'control-number'
UPDATE `search_field` SET `name` = 'place-of-publication', `label` = 'place-of-publication' WHERE `name` = 'place';
UPDATE `search_field` SET `name` = 'date-of-acquisition', `label` = 'date-of-acquisition' WHERE `name` = 'acqdate';
UPDATE `search_field` SET `name` = 'isbn', `label` = 'isbn' WHERE `name` = 'isbn';
UPDATE `search_field` SET `name` = 'authority-number', `label` = 'authority-number' WHERE `name` = 'an';
UPDATE `search_field` SET `name` = 'koha-auth-number', `label` = 'koha-auth-number' WHERE `name` = 'an';
UPDATE `search_field` SET `name` = 'subject', `label` = 'subject' WHERE `name` = 'subject';
UPDATE `search_field` SET `name` = 'publisher', `label` = 'publisher' WHERE `name` = 'publisher';
UPDATE `search_field` SET `name` = 'record-source', `label` = 'record-source' WHERE `name` = 'record-source';

Loading…
Cancel
Save