tweak to default suggestion for low-hits search
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 Apr 2011 17:26:51 +0000 (17:26 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 4 Apr 2011 20:27:34 +0000 (16:27 -0400)
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).

[Applying default skin change to KCLS skin]

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Open-ILS/web/opac/skin/kcls/js/result_common.js

index bb82f20..4a3f9f6 100644 (file)
@@ -392,7 +392,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 {