public function __construct(Connection $conn, array $flags = array())
 {
     parent::__construct($conn, null, null);
     if (in_array('same-cluster', $flags)) {
         $this->writeToClusterName = $this->connection->getClusterName();
     }
 }
 /**
  * @var Connection
  */
 public function __construct(Connection $conn)
 {
     parent::__construct($conn, null, null);
     $this->log = LoggerFactory::getInstance('CirrusSearch');
     $this->failedLog = LoggerFactory::getInstance('CirrusSearchChangeFailed');
 }
 /**
  * Constructor
  * @param int $offset Offset the results by this much
  * @param int $limit Limit the results to this many
  * @param SearchConfig Configuration settings
  * @param int[]|null $namespaces Array of namespace numbers to search or null to search all namespaces.
  * @param User|null $user user for which this search is being performed.  Attached to slow request logs.
  * @param string|boolean $index Base name for index to search from, defaults to wfWikiId()
  */
 public function __construct(Connection $conn, $offset, $limit, SearchConfig $config = null, array $namespaces = null, User $user = null, $index = false)
 {
     if (is_null($config)) {
         // @todo connection has an embeded config ... reuse that? somehow should
         // at least ensure they are the same.
         $config = ConfigFactory::getDefaultInstance()->makeConfig('CirrusSearch');
     }
     parent::__construct($conn, $user, $config->get('CirrusSearchSlowSearch'));
     $this->config = $config;
     $this->offset = min($offset, self::MAX_OFFSET);
     $this->limit = $limit;
     $this->namespaces = $namespaces;
     $this->indexBaseName = $index ?: $config->getWikiId();
     $this->language = $config->get('ContLang');
     $this->escaper = new Escaper($config->get('LanguageCode'), $config->get('CirrusSearchAllowLeadingWildcard'));
     $this->searchContext = new SearchContext($this->config);
 }
 protected function __construct(Connection $conn)
 {
     parent::__construct($conn, null, null);
     $this->linkCountMultiSearch = new \Elastica\Multi\Search($conn->getClient());
     $this->linkCountClosures = array();
 }
 /**
  * Constructor
  * @param int $limit Limit the results to this many
  * @param SearchConfig Configuration settings
  * @param int[]|null $namespaces Array of namespace numbers to search or null to search all namespaces.
  * @param User|null $user user for which this search is being performed.  Attached to slow request logs.
  * @param string|boolean $index Base name for index to search from, defaults to wfWikiId()
  */
 public function __construct(Connection $conn, $limit, SearchConfig $config = null, array $namespaces = null, User $user = null, $index = false)
 {
     if (is_null($config)) {
         // @todo connection has an embeded config ... reuse that? somehow should
         // at least ensure they are the same.
         $config = ConfigFactory::getDefaultInstance()->makeConfig('CirrusSearch');
     }
     parent::__construct($conn, $user, $config->get('CirrusSearchSlowSearch'));
     $this->config = $config;
     $this->limit = $limit;
     $this->indexBaseName = $index ?: $config->getWikiId();
     $this->searchContext = new SearchContext($this->config, $namespaces);
 }
 /**
  * Constructor
  */
 public function __construct(Connection $conn)
 {
     parent::__construct($conn, null, 0);
 }