Code Duplication    Length = 5-6 lines in 2 locations

src/Engines/TNTSearchEngine.php 2 locations

@@ 309-313 (lines=5) @@
306
    {
307
        $indexName = $model->searchableAs();
308
309
        if (!file_exists($this->tnt->config['storage']."/{$indexName}.index")) {
310
            $indexer = $this->tnt->createIndex("$indexName.index");
311
            $indexer->setDatabaseHandle($model->getConnection()->getPdo());
312
            $indexer->setPrimaryKey($model->getKeyName());
313
        }
314
        if ($this->geotnt && !file_exists($this->tnt->config['storage']."/{$indexName}.geoindex")) {
315
            $indexer = $this->geotnt->getIndex();
316
            $indexer->createIndex("$indexName.geoindex");
@@ 314-319 (lines=6) @@
311
            $indexer->setDatabaseHandle($model->getConnection()->getPdo());
312
            $indexer->setPrimaryKey($model->getKeyName());
313
        }
314
        if ($this->geotnt && !file_exists($this->tnt->config['storage']."/{$indexName}.geoindex")) {
315
            $indexer = $this->geotnt->getIndex();
316
            $indexer->createIndex("$indexName.geoindex");
317
            $indexer->setDatabaseHandle($model->getConnection()->getPdo());
318
            $indexer->setPrimaryKey($model->getKeyName());
319
        }
320
    }
321
322
    /**