Skip to content

Commit

Permalink
Disable output on createIndex
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sheriffmarley authored Feb 21, 2018
1 parent 6d8dba5 commit e75f1fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TNTSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e75f1fb

Please sign in to comment.