Commit 2cd0a2cd by Carsten Brandt

docs

[ci skip]
parent 325fc281
......@@ -15,12 +15,29 @@ use yii\helpers\Inflector;
use yii\helpers\Json;
use yii\helpers\StringHelper;
// TODO handle optimistic lock
/**
* ActiveRecord is the base class for classes representing relational data in terms of objects.
*
* This class implements the ActiveRecord pattern for the fulltext search and data storage
* [elasticsearch](http://www.elasticsearch.org/).
*
* For defining a record a subclass should at least implement the [[attributes()]] method to define
* attributes.
* The primary key (the `_id` field in elasticsearch terms) is represented by `getId()` and `setId()`.
*
* The following is an example model called `Customer`:
*
* ```php
* class Customer extends \yii\elasticsearch\ActiveRecord
* {
* public function attributes()
* {
* return ['id', 'name', 'address', 'registration_date'];
* }
* }
* ```
*
* You may override [[index()]] and [[type()]] to define the index and type this record represents.
*
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
......
<?php
/**
*
*
* @author Carsten Brandt <mail@cebe.cc>
*/
namespace yii\elasticsearch;
use yii\base\Object;
class Cluster extends Object
{
// TODO implement http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/cluster.html
}
\ No newline at end of file
......@@ -34,6 +34,9 @@ class Connection extends Component
)
);
// http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/_configuration.html#_example_configuring_http_basic_auth
public $auth = [];
// TODO use timeouts
/**
* @var float timeout to use for connection to redis. If not set the timeout set in php.ini will be used: ini_get("default_socket_timeout")
......@@ -92,6 +95,9 @@ class Connection extends Component
*/
public function open()
{
// TODO select one node to be the active one.
foreach($this->nodes as $key => $node) {
if (is_array($node)) {
$this->nodes[$key] = new Node($node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment