本文整理汇总了PHP中Elastica\Client::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::__construct方法的具体用法?PHP Client::__construct怎么用?PHP Client::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elastica\Client
的用法示例。
在下文中一共展示了Client::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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);
}
示例2: __construct
/**
* 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']);
}
示例3: __construct
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']);
}
示例4: __construct
/**
* 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);
}
示例5: __construct
public function __construct(\MagentoHackathon\Elasticsearch\Helper\ElasticOptionInterface $option, array $config = array(), $callback = null)
{
$this->_configHelper = $option;
parent::__construct($config, $callback);
}
示例6: __construct
/**
* 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);
}