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 of the query result. Null is returned if the query result is empty or the field does not exist.

doc_Yii
2016-10-30 17:02:09
Comments
Leave a Comment

Please login to continue.