From f50c73642a9a5cc226c56c55b9b0ed02e66fbb86 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Wed, 29 Jun 2016 11:57:43 +0100 Subject: [PATCH] Integrate with KB index. --- services/web/public/coffee/main/contact-us.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/web/public/coffee/main/contact-us.coffee b/services/web/public/coffee/main/contact-us.coffee index 18170952b6..fd1e720dd4 100644 --- a/services/web/public/coffee/main/contact-us.coffee +++ b/services/web/public/coffee/main/contact-us.coffee @@ -32,11 +32,10 @@ define [ _handleSearchResults = (success, results) -> suggestions = for hit in results.hits page_underscored = hit.pageName.replace(/\s/g,'_') - section_underscored = hit.sectionName.replace(/\s/g,'_') suggestion = - url :"/learn/#{page_underscored}##{section_underscored}" - name : hit._highlightResult.pageName.value + " - " + hit._highlightResult.sectionName.value + url :"/learn/kb/#{page_underscored}" + name : hit._highlightResult.pageName.value $scope.$applyAsync () -> $scope.suggestions = suggestions @@ -64,8 +63,7 @@ define [ $scope.$watch "form.subject", (newVal, oldVal) -> 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, { + algoliaSearch.searchKB newVal, _handleSearchResults, { hitsPerPage: 3 typoTolerance: 'strict' }