From 0551f27c83fff2cd977590067e0d52e8fa0478ed Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 27 Jun 2016 14:46:34 +0100 Subject: [PATCH] Extra search options; only search after three chars have been entered. --- services/web/public/coffee/main/contact-us.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/main/contact-us.coffee b/services/web/public/coffee/main/contact-us.coffee index 6f9ca36266..18170952b6 100644 --- a/services/web/public/coffee/main/contact-us.coffee +++ b/services/web/public/coffee/main/contact-us.coffee @@ -63,8 +63,12 @@ define [ $scope.$apply() $scope.$watch "form.subject", (newVal, oldVal) -> - if newVal and newVal != oldVal - algoliaSearch.searchWiki newVal, _handleSearchResults, { hitsPerPage: 3 } + if newVal and newVal != oldVal and newVal.length > 3 + # TODO Search the KB index instead; Wiki is used for testing purposes. + algoliaSearch.searchWiki newVal, _handleSearchResults, { + hitsPerPage: 3 + typoTolerance: 'strict' + } else $scope.suggestions = [];