Restrict # of hits returned; clear results on empty search string.

This commit is contained in:
Paulo Reis 2016-06-27 10:21:36 +01:00
parent c82f4481e4
commit c2ace9a0a0

View file

@ -64,9 +64,9 @@ define [
$scope.$watch "form.subject", (newVal, oldVal) ->
if newVal and newVal != oldVal
algoliaSearch.searchWiki newVal, _handleSearchResults
$scope.$watch "suggestions", (newVal) -> console.log newVal
algoliaSearch.searchWiki newVal, _handleSearchResults, { hitsPerPage: 3 }
else
$scope.suggestions = [];
$scope.close = () ->
$modalInstance.close()