Create local variable for Helper class in SphinxSearch

This commit is contained in:
DariusIII
2018-02-12 23:11:23 +01:00
parent aa97b8bf0d
commit 5bfd285b6f
2 changed files with 10 additions and 3 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-02-12 DariusIII
* Chg: Create local variable for Helper class in SphinxSearch
* Fix: Fix wrong categories used in searchByImdbId function
* Chg: Update exeu/apai-io to version 2.2.0
* Chg: Update composer.json, remove ext-yenc suggestion and add ext-bcmath as required
+9 -3
View File
@@ -24,6 +24,11 @@ class SphinxSearch
*/
protected $config;
/**
* @var \Foolz\SphinxQL\Helper
*/
protected $helper;
/**
* Establish connection to SphinxQL.
*
@@ -35,6 +40,7 @@ class SphinxSearch
$this->config = config('sphinxsearch');
$this->connection->setParams(['host' => $this->config['host'], 'port' => $this->config['port']]);
$this->sphinxQL = SphinxQL::create($this->connection);
$this->helper = Helper::create($this->connection);
}
/**
@@ -110,7 +116,7 @@ class SphinxSearch
*/
public function truncateRTIndex(): void
{
Helper::create($this->connection)->truncateRtIndex($this->config['index']);
$this->helper->truncateRtIndex($this->config['index']);
}
/**
@@ -118,7 +124,7 @@ class SphinxSearch
*/
public function optimizeRTIndex(): void
{
Helper::create($this->connection)->flushRtIndex($this->config['index']);
Helper::create($this->connection)->optimizeIndex($this->config['index']);
$this->helper->flushRtIndex($this->config['index']);
$this->helper->optimizeIndex($this->config['index']);
}
}