@@ -, +, @@ --- C4/Heading.pm | 2 +- Koha/SearchEngine/Elasticsearch/QueryBuilder.pm | 3 ++- t/db_dependent/Heading.t | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) --- a/C4/Heading.pm +++ a/C4/Heading.pm @@ -244,7 +244,7 @@ sub _search { # This is legal, so we do a fallback search if( !$total && $thesaurus && !( grep /$thesaurus/,('lcsh','lcac','mesh','nal','notspecified','cash','rvm','sears','aat') ) ){ pop @value; - push @value, 'z'; + push @value, 'notdefined'; $search_query = $builder->build_authorities_query_compat( \@marclist, \@and_or, \@excluding, \@operator, \@value, $self->{'auth_type'}, --- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm +++ a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -577,7 +577,8 @@ our $thesaurus_to_value = { cash => 'k', rvm => 'v', aat => 'r', - sears => 's' + sears => 's', + notdefined => 'z' }; sub build_authorities_query_compat { --- a/t/db_dependent/Heading.t +++ a/t/db_dependent/Heading.t @@ -165,6 +165,6 @@ subtest "_search tests" => sub { { term => { 'match-heading.ci_raw' => 'Uncles generalsubdiv Fiction' } }, { term => { 'subject-heading-thesaurus.ci_raw' => 'z' } }, ]; - is_deeply( $terms, $expected_terms, "When thesaurus in subfield 2, and nothing is found, we should search again for 008_11 = z"); + is_deeply( $terms, $expected_terms, "When thesaurus in subfield 2, and nothing is found, we should search again for notdefined (008_11 = z) "); }; --