Creates a new Elastica client.
public __construct ( array $config = [], callback $callback = null, Psr\Log\LoggerInterface $logger = null ) | ||
$config | array | OPTIONAL Additional config options |
$callback | callback | OPTIONAL Callback function which can be used to be notified about errors (for example connection down) |
$logger | Psr\Log\LoggerInterface |
/** * Constructor. Appends the default index name to the config array, which by default * is `_all` * * @param array $config config options * @param callback $callback Callback function which can be used to be notified * about errors (for example connection down) */ public function __construct(array $config = [], $callback = null) { $config += ['index' => '_all']; if (isset($config['name'])) { $this->configName = $config['name']; } parent::__construct($config, $callback); }
/** * Initializes search engine config and index name. */ public function __construct() { $this->_helper = Mage::helper('bubble_search/elasticsearch'); $config = $this->_helper->getEngineConfigData(); parent::__construct($config); if (!isset($config['index'])) { Mage::throwException('Index must be defined for search engine client.'); } $this->setIndex($config['index']); }
public function __construct() { $this->_helper = Mage::helper('nanowebg_elasticsearch/elasticsearch'); $config = $this->_helper->getEngineConfig(); if (Mage::helper('nanowebg_elasticsearch')->isLog()) { Mage::log('Initiating NanoWebG_ElasticSearch_Model_Resource_Elasticsearch_Client', null, 'elasticsearch_debug.log'); } parent::__construct($config); if (!isset($config['index'])) { Mage::throwException('Index must be defined for search engine client.'); } $this->setIndex($config['index']); }
/** * Constructor * * @param array $options * @param LoggerInterface $logger */ public function __construct(array $options, LoggerInterface $logger) { if (isset($options['servers'])) { $resolver = new OptionsResolver(); $this->globalOptions($resolver); foreach ($options['servers'] as $index => $opts) { $options['servers'][$index] = $resolver->resolve($opts); } } $resolver = new OptionsResolver(); $this->globalOptions($resolver); $options = $resolver->resolve($options); parent::__construct($options); $this->setLogger($logger); }
public function __construct(\MagentoHackathon\Elasticsearch\Helper\ElasticOptionInterface $option, array $config = array(), $callback = null) { $this->_configHelper = $option; parent::__construct($config, $callback); }
/** * Set the Elasticsearch Node Connection Data * * @var array */ public final function __construct($options) { $config = array('servers' => Mage::helper('elasticgento/config')->getElasticsearchNodeConnectionData()); //call elastica constructor parent::__construct($config); }