elasticsearch\Query count()

count() public method Returns the number of records. public integer count ( $q = '*', $db = null )$q string The COUNT expression. This parameter is ignored by this implementation. $db yii\elasticsearch\Connection The database connection used to execute the query. If this parameter is not given, the elasticsearch application component will be used. return integer Number of records

elasticsearch\Query column()

column() public method Executes the query and returns the first column of the result. public array column ( $field, $db = null )$field string The field to query over $db yii\elasticsearch\Connection The database connection used to execute the query. If this parameter is not given, the elasticsearch application component will be used. return array The first column of the query result. An empty array is returned if the query results in nothing.

elasticsearch\Query batch()

batch() public method (available since version 2.0.4) Starts a batch query. A batch query supports fetching data in batches, which can keep the memory usage under a limit. This method will return a yii\elasticsearch\BatchQueryResult object which implements the Iterator interface and can be traversed to retrieve the data in batches. For example, $query = (new Query)->from('user'); foreach ($query->batch() as $rows) { // $rows is an array of 10 or fewer rows from user table } Batch

elasticsearch\Query all()

all() public method Executes the query and returns all results as an array. public array all ( $db = null )$db yii\elasticsearch\Connection The database connection used to execute the query. If this parameter is not given, the elasticsearch application component will be used. return array The query results. If the query results in nothing, an empty array will be returned.

elasticsearch\Query addSuggester()

addSuggester() public method Adds a suggester to this query. See also http://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html. public $this addSuggester ( $name, $definition )$name string The name of the suggester $definition string|array The configuration options for this suggester. Can be an array or a json string. return $this The query object itself

elasticsearch\Query addOptions()

addOptions() public method (available since version 2.0.4) Adds more options, overwriting existing options. See also options(). public $this addOptions ( $options )$options array The options to be added. return $this The query object itself throws yii\base\InvalidParamException if $options is not an array

elasticsearch\Query addAggregation()

addAggregation() public method See also http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations.html. public $this addAggregation ( $name, $type, $options )$name string The name of the aggregation $type string The aggregation type. e.g. terms, range, histogram... $options string|array The configuration options for this aggregation. Can be an array or a json string. return $this The query object itself

elasticsearch\Query addAggregate()

addAggregate() public method Adds an aggregation to this query. Supports nested aggregations. See also https://www.elastic.co/guide/en/elasticsearch/reference/2.3/search-aggregations.html. public $this addAggregate ( $name, $options )$name string The name of the aggregation $options string|array The configuration options for this aggregation. Can be an array or a json string. return $this The query object itself

elasticsearch\Query addAgg()

addAgg() public method See also http://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-aggregations.html. public $this addAgg ( $name, $type, $options )$name string The name of the aggregation $type string The aggregation type. e.g. terms, range, histogram... $options string|array The configuration options for this aggregation. Can be an array or a json string. return $this The query object itself

elasticsearch\Query $type

$type public property The type to retrieve data from. This can be a string representing a single type or a an array of multiple types. If this is not set, all types are being queried. See also from(). public string|array $type = null