From 9c32ccc78b853beced2f6971d2357c6175100144 Mon Sep 17 00:00:00 2001 From: gmc Date: Mon, 4 Apr 2011 17:26:31 +0000 Subject: [PATCH] tweak to default suggestion for low-hits search Rather than show a suggestion for every word in the original search phrase, only display suggestions for words not found in the dictionary. For example, rather than having a search for "Amesh paradise" return a suggestion of "Amish paraders", return "Amish paradise" as the suggestion (assuming the default dictionaries are used). Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@19964 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/result_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 39dc2382e3..dfd5455be5 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -330,7 +330,7 @@ function resultSuggestSpelling(r) { if( blob ) blob = blob[0]; else continue; if( blob.word == word ) { - if( blob.suggestions && blob.suggestions[0] ) { + if( !blob.found && blob.suggestions && blob.suggestions[0] ) { newterm += " " + blob.suggestions[0]; unHideMe($('did_you_mean')); } else { -- 2.11.0