diff --git a/modules/search_api_db/src/Plugin/search_api/backend/Database.php b/modules/search_api_db/src/Plugin/search_api/backend/Database.php
index 27dd089..8487a24 100644
--- a/modules/search_api_db/src/Plugin/search_api/backend/Database.php
+++ b/modules/search_api_db/src/Plugin/search_api/backend/Database.php
@@ -2260,7 +2260,7 @@ protected function getFacets(QueryInterface $query, SelectInterface $db_query) {
         $select->range(0, $limit);
       }
       if ($facet['min_count'] > 1) {
-        $select->having('num >= :count', array(':count' => $facet['min_count']));
+        $select->having('COUNT(DISTINCT t.item_id) >= :count', array(':count' => $facet['min_count']));
       }
 
       $terms = array();
@@ -2479,7 +2479,7 @@ public function getAutocompleteSuggestions(QueryInterface $query, SearchApiAutoc
       $db_query->addExpression('COUNT(DISTINCT item_id)', 'results');
       $db_query->fields('t', array('word'))
         ->groupBy('word')
-        ->having('results <= :max', array(':max' => $max_occurrences))
+        ->having('COUNT(DISTINCT item_id) <= :max', array(':max' => $max_occurrences))
         ->orderBy('results', 'DESC')
         ->range(0, $limit);
       $incomp_len = strlen($incomplete_key);
diff --git a/tests/src/Kernel/BackendTestBase.php b/tests/src/Kernel/BackendTestBase.php
index 4b11af4..adb91c9 100644
--- a/tests/src/Kernel/BackendTestBase.php
+++ b/tests/src/Kernel/BackendTestBase.php
@@ -457,6 +457,7 @@ protected function regressionTests() {
     $this->regressionTest1658964();
     $this->regressionTest2469547();
     $this->regressionTest1403916();
+    $this->regressionTest2783987();
   }
 
   /**
@@ -760,6 +761,30 @@ protected function regressionTest1403916() {
   }
 
   /**
+   * Regression test for facet with "min_count" greater than 1.
+   *
+   * @see https://www.drupal.org/node/2783987
+   */
+  protected function regressionTest2783987() {
+    $query = $this->buildSearch('test foo');
+    $facets = array();
+    $facets['type'] = array(
+      'field' => 'type',
+      'limit' => 0,
+      'min_count' => 2,
+      'missing' => TRUE,
+    );
+    $query->setOption('search_api_facets', $facets);
+    $query->range(0, 0);
+    $results = $query->execute();
+    $expected = array(
+      array('count' => 2, 'filter' => '"item"'),
+    );
+    $facets = $results->getExtraData('search_api_facets', array())['type'];
+    $this->assertEquals($expected, $facets, 'Correct facets were returned');
+  }
+
+  /**
    * Compares two facet filters to determine their order.
    *
    * Used as a callback for usort() in regressionTests().
