diff --git a/assets/js/just-the-docs.js b/assets/js/just-the-docs.js
index 275327307d66bd6ccb888a09d199f15e4b130a28..ca91555431c284117b4a1929fdd8d764e11384ca 100644
--- a/assets/js/just-the-docs.js
+++ b/assets/js/just-the-docs.js
@@ -157,12 +157,16 @@ function searchLoaded(index, docs) {
     });
 
     if ((results.length == 0) && (input.length > 2)) {
-      results = index.query(function (query) {
-        var tokens = lunr.tokenizer(input)
-        query.term(tokens, {
-          editDistance: Math.round(Math.sqrt(input.length / 2 - 1))
+      var tokens = lunr.tokenizer(input).filter(function(token, i) {
+        return token.str.length < 20;
+      })
+      if (tokens.length > 0) {
+        results = index.query(function (query) {
+          query.term(tokens, {
+            editDistance: Math.round(Math.sqrt(input.length / 2 - 1))
+          });
         });
-      });
+      }
     }
 
     if (results.length == 0) {