Documentation

Cluster

Cluster is an object containing functionality for performing cluster level operations against a cluster and for access to buckets.

Table of Contents

__construct()  : mixed
analyticsIndexes()  : AnalyticsIndexManager
Creates a new query index manager object for managing analytics query indexes.
analyticsQuery()  : AnalyticsResult
Executes an analytics query against the cluster.
bucket()  : Bucket
Returns a new bucket object.
buckets()  : BucketManager
Creates a new bucket manager object for managing buckets.
query()  : QueryResult
Executes a N1QL query against the cluster.
queryIndexes()  : QueryIndexManager
Creates a new query index manager object for managing N1QL query indexes.
searchIndexes()  : SearchIndexManager
Creates a new search index manager object for managing search query indexes.
searchQuery()  : SearchResult
Executes a full text search query against the cluster.
users()  : UserManager
Creates a new user manager object for managing users and groups.

Methods

analyticsQuery()

Executes an analytics query against the cluster.

public analyticsQuery(string $statement[, AnalyticsOptions $options = null ]) : AnalyticsResult

Note: On Couchbase Server versions < 6.5 a bucket must be opened before using analyticsQuery.

Parameters
$statement : string

the analytics query statement to execute

$options : AnalyticsOptions = null

the options to use when executing the query

Return values
AnalyticsResult

bucket()

Returns a new bucket object.

public bucket(string $name) : Bucket
Parameters
$name : string

the name of the bucket

Return values
Bucket

query()

Executes a N1QL query against the cluster.

public query(string $statement[, QueryOptions $options = null ]) : QueryResult

Note: On Couchbase Server versions < 6.5 a bucket must be opened before using query.

Parameters
$statement : string

the N1QL query statement to execute

$options : QueryOptions = null

the options to use when executing the query

Return values
QueryResult

searchQuery()

Executes a full text search query against the cluster.

public searchQuery(string $indexName, SearchQuery $query[, SearchOptions $options = null ]) : SearchResult

Note: On Couchbase Server versions < 6.5 a bucket must be opened before using searchQuery.

Parameters
$indexName : string

the fts index to use for the query

$query : SearchQuery

the search query to execute

$options : SearchOptions = null

the options to use when executing the query

Return values
SearchResult

Search results