public function waitUntilIndexingFinished($maxWaitingTime = 15)
    {
        if (!$this->database->fullTextEnabled()) {
            return;
        }

        $this->query("EXEC sp_fulltext_catalog 'ftCatalog', 'Rebuild';");

        // Busy wait until it's done updating, but no longer than 15 seconds.
        $start = time();
        while (time() - $start < $maxWaitingTime) {
            $status = $this->query("EXEC sp_help_fulltext_catalogs 'ftCatalog';")->first();

            if (isset($status['STATUS']) && $status['STATUS'] == 0) {
                // Idle!
                break;
            }
            sleep(1);
        }
    }