elasticsearch\Query timeout()

timeout() public method Sets the search timeout. See also http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#_parameters_5. public $this timeout ( $timeout )$timeout integer A search timeout, bounding the search request to be executed within the specified time value and bail with the hits accumulated up to that point when expired. Defaults to no timeout. return $this The query object itself

elasticsearch\Query stats()

stats() public method Adds a 'stats' part to the query. See also http://www.elastic.co/guide/en/elasticsearch/reference/current/search.html#stats-groups. public $this stats ( $groups )$groups array An array of groups to maintain a statistics aggregation for. return $this The query object itself

elasticsearch\Query source()

source() public method Sets the source filtering, specifying how the _source field of the document should be returned. See also http://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-source-filtering.html. public $this source ( $source )$source array The source patterns to be selected. return $this The query object itself

elasticsearch\Query search()

search() public method Executes the query and returns the complete search result including e.g. hits, facets, totalCount. public array search ( $db = null, $options = [] )$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. $options array The options given with this query. Possible options are: routing search_type return array The query results.

elasticsearch\Query scalar()

scalar() public method Returns the query result as a scalar value. The value returned will be the specified field in the first document of the query results. public string scalar ( $field, $db = null )$field string Name of the attribute to select $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 string The value of the specified attribute in the first record

elasticsearch\Query query()

query() public method Sets the querypart of this search query. public $this query ( $query )$query string return $this The query object itself

elasticsearch\Query postFilter()

postFilter() public method (available since version 2.0.5) Set the post_filter part of the search query. See also $postFilter. public $this postFilter ( $filter )$filter string|array return $this The query object itself

elasticsearch\Query populate()

populate() public method (available since version 2.0.4) Converts the raw query results into the format as specified by this query. This method is internally used to convert the data fetched from database into the format as required by this query. public array populate ( $rows )$rows array The raw query result from database return array The converted query result

elasticsearch\Query options()

options() public method (available since version 2.0.4) Sets the options to be passed to the command created by this query. See also yii\elasticsearch\Command::$options. public $this options ( $options )$options array The options to be set. return $this The query object itself throws yii\base\InvalidParamException if $options is not an array

elasticsearch\Query one()

one() public method Executes the query and returns a single row of result. public array|boolean one ( $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|boolean The first row (in terms of an array) of the query result. False is returned if the query results in nothing.