From e75f1fb7c329d02099d2930bcfdd3430ea51b0b8 Mon Sep 17 00:00:00 2001 From: sheriffmarley <36710078+sheriffmarley@users.noreply.github.com> Date: Wed, 21 Feb 2018 20:02:19 +0100 Subject: [PATCH] Disable output on createIndex I followed your tutorial here http://tnt.studio/blog/did-you-mean-functionality-with-laravel-scout where you explain how to create trigrams. If the function `createIndex` is called there is no way to disable the ouput of the `TNTINdexer`. This is suboptimal if you have an api whereof you can create posts or sth. else and run the trigram generator directly after the creation process. --- src/TNTSearch.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TNTSearch.php b/src/TNTSearch.php index e4e5a5a..899ed75 100644 --- a/src/TNTSearch.php +++ b/src/TNTSearch.php @@ -60,13 +60,15 @@ public function setTokenizer(TokenizerInterface $tokenizer) /** * @param string $indexName + * @param boolean $disableOutput * * @return TNTIndexer */ - public function createIndex($indexName) + public function createIndex($indexName, $disableOutput = false) { $indexer = new TNTIndexer; $indexer->loadConfig($this->config); + $indexer->disableOutput = $disableOutput; if ($this->dbh) { $indexer->setDatabaseHandle($this->dbh);