From e23a099cba4a1e42a705dd9586713068b8a7cb30 Mon Sep 17 00:00:00 2001 From: Timotheus Kampik Date: Sun, 5 Jun 2016 15:56:50 +0200 Subject: [PATCH] searchtools.js_t: don't stem words if it cuts them to less than 3 characters #1529 --- sphinx/themes/basic/static/searchtools.js_t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sphinx/themes/basic/static/searchtools.js_t b/sphinx/themes/basic/static/searchtools.js_t index 8a150b272..af0e21a37 100644 --- a/sphinx/themes/basic/static/searchtools.js_t +++ b/sphinx/themes/basic/static/searchtools.js_t @@ -159,6 +159,10 @@ var Search = { } // stem the word var word = stemmer.stemWord(tmp[i].toLowerCase()); + // prevent stemmer from cutting word smaller than two chars + if(word.length < 3 && tmp[i].length >= 3) { + word = tmp[i]; + } var toAppend; // select the correct list if (word[0] == '-') {