From: Bill Erickson Date: Tue, 15 Oct 2019 20:10:56 +0000 (-0400) Subject: stripdots and spacedots analyzers X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e1c3b975ef1f33f954f06f0fc607a625486e51eb;p=working%2FEvergreen.git stripdots and spacedots analyzers Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/BibSearch.pm b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/BibSearch.pm index e53cacb6ba..1d5340d343 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Elastic/BibSearch.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Elastic/BibSearch.pm @@ -39,6 +39,18 @@ my $BASE_INDEX_SETTINGS = { folding => { filter => ['lowercase', 'asciifolding'], tokenizer => 'standard' + }, + stripdots => { + # "R.E.M." => "REM" + char_filter => ['stripdots'], + filter => ['lowercase'], + tokenizer => 'standard' + }, + spacedots => { + # "R.E.M." => "R E M" + char_filter => ['spacedots'], + filter => ['lowercase'], + tokenizer => 'standard' } }, normalizer => { @@ -46,6 +58,16 @@ my $BASE_INDEX_SETTINGS = { type => 'custom', filter => ['lowercase'] } + }, + char_filter => { + stripdots => { + type => 'mapping', + mappings => ['. =>'] + }, + spacedots => { + type => 'mapping', + mappings => ['. => " "'] + } } } }; @@ -105,7 +127,9 @@ my $BASE_PROPERTIES = { normalizer => 'custom_lowercase', fields => { text => {type => 'text'}, - text_folded => {type => 'text', analyzer => 'folding'} + text_folded => {type => 'text', analyzer => 'folding'}, + text_spacedots => {type => 'text', analyzer => 'spacedots'}, + text_stripdots => {type => 'text', analyzer => 'stripdots'} } }, author => { @@ -114,7 +138,9 @@ my $BASE_PROPERTIES = { normalizer => 'custom_lowercase', fields => { text => {type => 'text'}, - text_folded => {type => 'text', analyzer => 'folding'} + text_folded => {type => 'text', analyzer => 'folding'}, + text_spacedots => {type => 'text', analyzer => 'spacedots'}, + text_stripdots => {type => 'text', analyzer => 'stripdots'} } }, subject => { @@ -123,7 +149,9 @@ my $BASE_PROPERTIES = { normalizer => 'custom_lowercase', fields => { text => {type => 'text'}, - text_folded => {type => 'text', analyzer => 'folding'} + text_folded => {type => 'text', analyzer => 'folding'}, + text_spacedots => {type => 'text', analyzer => 'spacedots'}, + text_stripdots => {type => 'text', analyzer => 'stripdots'} } }, series => { @@ -132,7 +160,9 @@ my $BASE_PROPERTIES = { normalizer => 'custom_lowercase', fields => { text => {type => 'text'}, - text_folded => {type => 'text', analyzer => 'folding'} + text_folded => {type => 'text', analyzer => 'folding'}, + text_spacedots => {type => 'text', analyzer => 'spacedots'}, + text_stripdots => {type => 'text', analyzer => 'stripdots'} } }, keyword => { @@ -143,7 +173,9 @@ my $BASE_PROPERTIES = { ignore_above => 256, fields => { text => {type => 'text'}, - text_folded => {type => 'text', analyzer => 'folding'} + text_folded => {type => 'text', analyzer => 'folding'}, + text_spacedots => {type => 'text', analyzer => 'spacedots'}, + text_stripdots => {type => 'text', analyzer => 'stripdots'} } }, identifier => {