       return res?.facets?.content_type?.buckets[idx].count ? 0
 
     findResult = (typeName, res) ->
-      console.log("RESULT IS", res)
       if res != null
         groups = (group.groupValue for group in res.grouped.content_type.groups)
         return groups.indexOf(typeName)

    $scope.searchBox = ->
      console.log("The search box was :", $scope.searchBoxQuery)
      console.log("The original query was :", $scope.originalQuery)
      if $scope.searchBoxQuery? and $scope.searchBoxQuery != ""
        $scope.originalQuery = $scope.searchBoxQuery
      else
        $scope.originalQuery = "*"
      $scope.query = $scope.originalQuery
      $scope.offset = 0
      console.log("NEW SEARCH:", $scope.query)

        $scope.query = "*"
        $scope.search()
        return

      models = createModels(res)
      $scope.partyModels = models.parties
      $scope.volumeModels = models.volumes
