'127.0.0.1', 'port' => 9200, 'index' => '', 'shards' => 3, 'replicas' => 0, 'minScore' => 4, 'highlight' => true ], $options); $self = new self(); $self->setHost($options['host']); $self->setPort($options['port']); $self->setIndexName($options['index']); $self->setShards($options['shards']); $self->setReplicas($options['replicas']); $self->setMinScore($options['minScore']); $self->setHighlight($options['highlight']); return $self; } /** * @return array */ public function toArray() { return [ 'host' => $this->host, 'port' => $this->port, 'index' => $this->indexName, 'shards' => $this->shards, 'replicas' => $this->replicas, 'minScore' => $this->minScore, 'highlight' => $this->highlight, ]; } /** * @param string $host */ public function setHost($host) { $this->host = $host; } /** * @return string */ public function getHost() { return $this->host; } /** * @param int $port */ public function setPort($port) { $this->port = (int)$port; } /** * @return int */ public function getPort() { return $this->port; } /** * @param int $minScore */ public function setMinScore($minScore) { $this->minScore = (int)$minScore; } /** * @return int */ public function getMinScore() { return $this->minScore; } /** * @param string $indexName */ public function setIndexName($indexName) { $this->indexName = $indexName; } /** * @return string */ public function getIndexName() { return $this->indexName; } /** * @param int $shards */ public function setShards($shards) { $this->shards = (int)$shards; } /** * @return int */ public function getShards() { return $this->shards; } /** * @param int $replicas */ public function setReplicas($replicas) { $this->replicas = (int)$replicas; } /** * @return int */ public function getReplicas() { return $this->replicas; } /** * @return bool */ public function getHighlight() { return $this->highlight; } /** * @param bool $highlight */ public function setHighlight($highlight) { $this->highlight = $highlight; } }