From: Dan Wells Date: Thu, 7 Jul 2011 21:18:16 +0000 (-0400) Subject: Make spell-checking case insensitive X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bfd440d9150ae2812ff50e2e27cfbd4bf0fc96d2;p=evergreen%2Ftadl.git Make spell-checking case insensitive As it stands, if you search for a proper noun using lower case, but manage to trigger the "did you mean" functionality, all the words are 'corrected' even if just the case is wrong. However, we are stripping out the best correction precisely because it is the same word, different case. It is a bit confusing to explain, but here is an example: daniel potatoe gets corrected to: Daniela potato This happens because the current spell check is case sensitive, so 'daniel' is spelled wrong, but then we remove 'Daniel' from the list of corrections (presumably to avoid possibly suggesting terms which would yield the same exact result set). So, we either need to make the spell-check itself case insensitive, or stop removing the re-cased corrections. Since the catalog search itself is already case-insensitive, I think it makes sense that the spell check should follow suit. Signed-off-by: Dan Wells Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search.pm index 6de6225a73..7a2851da30 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search.pm @@ -88,6 +88,8 @@ sub spellcheck { $logger->debug("spelling dictionary set to $dict"); } + $speller->set_option('ignore-case', 'true'); + my @resp; for my $word (split(/\s+/,$phrase) ) {