protected function getIndex() { $connection = new Search_Elastic_Connection('http://localhost:9200'); $connection->startBulk(100); $status = $connection->getStatus(); if (!$status->ok) { $this->markTestSkipped('ElasticSearch needs to be available on localhost:9200 for the test to run.'); } return new Search_Elastic_Index($connection, 'test_index'); }
function setUp() { $connection = new Search_Elastic_Connection('http://localhost:9200'); $connection->startBulk(100); $status = $connection->getStatus(); if (!$status->ok) { $this->markTestSkipped('Elasticsearch needs to be available on localhost:9200 for the test to run.'); } $this->index = new Search_Elastic_Index($connection, 'test_index'); $this->index->destroy(); }
private function getElasticConnection($useMasterOnly) { global $prefs; static $connections = []; $target = $prefs['unified_elastic_url']; if (!$useMasterOnly && $prefs['federated_elastic_url']) { $target = $prefs['federated_elastic_url']; } if (!empty($connections[$target])) { return $connections[$target]; } $connection = new Search_Elastic_Connection($target); $connection->startBulk(); $connection->persistDirty(TikiLib::events()); $connections[$target] = $connection; return $connection; }
private function getElasticConnection() { global $prefs; $connection = new Search_Elastic_Connection($prefs['unified_elastic_url']); $connection->startBulk(); return $connection; }