From: Bill Erickson Date: Fri, 13 Sep 2019 17:21:57 +0000 (-0400) Subject: create some query_string shortcuts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=809ef47f72326ada9a2d5d1db38856f095d1660a;p=working%2FEvergreen.git create some query_string shortcuts Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm index c36e9e97b5..b110a8145b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/Bib/Search.pm @@ -141,9 +141,26 @@ my $BASE_PROPERTIES = { # Avoid full-text indexing on identifier fields. type => 'keyword', normalizer => 'custom_lowercase', - } + }, + + # Create some shortcut indexes for streamlining query_string searches. + ti => {type => 'text'}, + au => {type => 'text'}, + se => {type => 'text'}, + su => {type => 'text'}, + kw => {type => 'text'}, + id => {type => 'keyword'} }; +my %SHORT_GROUP_MAP = ( + title => 'ti', + author => 'au', + subject => 'su', + series => 'se', + keyword => 'kw', + identifier => 'id' +); + sub index_name { return $INDEX_NAME; } @@ -196,7 +213,7 @@ sub create_index { # Use the same fields and analysis as the 'grouped' field. $def = clone($mappings->{$search_group}); - $def->{copy_to} = $search_group if $search_group; + $def->{copy_to} = [$search_group, $SHORT_GROUP_MAP{$search_group}]; # Apply ranking boost to each analysis variation. my $flds = $def->{fields};