Documentation

Couchbase

Interfaces, Classes and Traits

Authenticator
Interface of authentication containers.
ViewQueryEncodable
Common interface for all View queries
SearchQueryPart
Common interface for all classes, which could be used as a body of SearchQuery
SearchFacet
Common interface for all search facets
Exception
Exception represeting all errors generated by the extension
Document
Represents Couchbase Document, which stores metadata and the value.
DocumentFragment
A fragment of a JSON Document returned by the sub-document API.
Cluster
Represents a Couchbase Server Cluster.
ClusterManager
Provides management capabilities for a Couchbase Server Cluster
UserSettings
Represents settings for new/updated user.
Bucket
Represents connection to the Couchbase Server
BucketManager
Provides management capabilities for the Couchbase Bucket
SearchIndexManager
Interface for working with Full Text Search indexes.
ClassicAuthenticator
Authenticator based on login/password credentials.
PasswordAuthenticator
Authenticator based on RBAC feature of Couchbase Server 5+.
CertAuthenticator
Authenticator for Client Certificate authentication feature of Couchbase Server 5+.
MutationToken
An object which contains meta information of the document needed to enforce query consistency.
MutationState
Container for mutation tokens.
ViewQuery
Represents regular Couchbase Map/Reduce View query
SpatialViewQuery
Represents spatial Couchbase Map/Reduce View query
N1qlQuery
Represents a N1QL query
N1qlIndex
Represents N1QL index definition
LookupInBuilder
A builder for subdocument lookups. In order to perform the final set of operations, use the execute() method.
MutateInBuilder
A builder for subdocument mutations. In order to perform the final set of operations, use the execute() method.
SearchQuery
Represents full text search query
BooleanFieldSearchQuery
A FTS query that queries fields explicitly indexed as boolean.
BooleanSearchQuery
A compound FTS query that allows various combinations of sub-queries.
ConjunctionSearchQuery
A compound FTS query that performs a logical AND between all its sub-queries (conjunction).
DisjunctionSearchQuery
A compound FTS query that performs a logical OR between all its sub-queries (disjunction). It requires that a minimum of the queries match. The minimum is configurable (default 1).
DateRangeSearchQuery
A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured.
NumericRangeSearchQuery
A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured.
DocIdSearchQuery
A FTS query that matches on Couchbase document IDs. Useful to restrict the search space to a list of keys (by using this in a compound query).
MatchAllSearchQuery
A FTS query that matches all indexed documents (usually for debugging purposes).
MatchNoneSearchQuery
A FTS query that matches 0 document (usually for debugging purposes).
MatchPhraseSearchQuery
A FTS query that matches several given terms (a "phrase"), applying further processing like analyzers to them.
MatchSearchQuery
A FTS query that matches a given term, applying further processing to it like analyzers, stemming and even #fuzziness(int).
PhraseSearchQuery
A FTS query that matches several terms (a "phrase") as is. The order of the terms mater and no further processing is applied to them, so they must appear in the index exactly as provided. Usually for debugging purposes, prefer MatchPhraseQuery.
RegexpSearchQuery
A FTS query that allows for simple matching of regular expressions.
WildcardSearchQuery
A FTS query that allows for simple matching using wildcard characters (* and ?).
PrefixSearchQuery
A FTS query that allows for simple matching on a given prefix.
QueryStringSearchQuery
A FTS query that performs a search according to the "string query" syntax.
TermSearchQuery
A facet that gives the number of occurrences of the most recurring terms in all hits.
TermRangeSearchQuery
A FTS query that matches documents on a range of values. At least one bound is required, and the inclusiveness of each bound can be configured.
GeoDistanceSearchQuery
A FTS query that finds all matches from a given location (point) within the given distance.
GeoBoundingBoxSearchQuery
A FTS query which allows to match geo bounding boxes.
TermSearchFacet
A facet that gives the number of occurrences of the most recurring terms in all hits.
DateRangeSearchFacet
A facet that categorizes hits inside date ranges (or buckets) provided by the user.
NumericRangeSearchFacet
A facet that categorizes hits into numerical ranges (or buckets) provided by the user.
SearchSort
Base class for all FTS sort options in querying.
SearchSortId
Sort by the document identifier.
SearchSortScore
Sort by the hit score.
SearchSortField
Sort by a field in the hits.
SearchSortGeoDistance
Sort by a location and unit in the hits.
AnalyticsQuery
Represents a Analytics query (currently experimental support).

Table of Contents

fastlzCompress() Compress input using FastLZ algorithm.
fastlzDecompress() Decompress input using FastLZ algorithm.
zlibCompress() Compress input using zlib. Raises Exception when extension compiled without zlib support.
zlibDecompress() Compress input using zlib. Raises Exception when extension compiled without zlib support.
passthruDecoder() Returns value as it received from the server without any transformations.
passthruEncoder() Returns the value, which has been passed and zero as flags and datatype.
defaultDecoder() Decodes value using \Couchbase\basicDecoderV1.
defaultEncoder() Encodes value using \Couchbase\basicDecoderV1.
basicDecoderV1() Decodes value according to Common Flags (RFC-20)
basicEncoderV1() Encodes value according to Common Flags (RFC-20)

Functions

fastlzCompress()

Compress input using FastLZ algorithm.

fastlzCompress( $data : string ) : string
Parameters
$data : string

original data

Return values
string

compressed binary string

fastlzDecompress()

Decompress input using FastLZ algorithm.

fastlzDecompress( $data : string ) : string
Parameters
$data : string

compressed binary string

Return values
string

original data

zlibCompress()

Compress input using zlib. Raises Exception when extension compiled without zlib support.

zlibCompress( $data : string ) : string
Parameters
$data : string

original data

Tags
see
Return values
string

compressed binary string

zlibDecompress()

Compress input using zlib. Raises Exception when extension compiled without zlib support.

zlibDecompress( $data : string ) : string
Parameters
$data : string

compressed binary string

Tags
see
Return values
string

original data

passthruDecoder()

Returns value as it received from the server without any transformations.

passthruDecoder( $bytes : string , $flags : int , $datatype : int ) : string

It is useful for debug purpose to inspect bare value.

Parameters
$bytes : string
$flags : int
$datatype : int
Tags
example

examples/api/couchbase.passthruDecoder.php

see
Return values
string

Document as it received from the Couchbase.

passthruEncoder()

Returns the value, which has been passed and zero as flags and datatype.

passthruEncoder( $value : string ) : array

It is useful for debug purposes, or when the value known to be a string, otherwise behavior is not defined (most likely it will generate error).

Parameters
$value : string

document to be stored in the Couchbase

Tags
see
Return values
array

Array with three values: [bytes, 0, 0]

defaultDecoder()

Decodes value using \Couchbase\basicDecoderV1.

defaultDecoder( $bytes : string , $flags : int , $datatype : int ) : mixed

It passes couchbase.decoder.* INI properties as $options.

Parameters
$bytes : string

Binary string received from the Couchbase, which contains encoded document

$flags : int

Flags which describes document encoding

$datatype : int

Extra field for datatype (not used at the moment)

Tags
see
see
Return values
mixed

Decoded document object

defaultEncoder()

Encodes value using \Couchbase\basicDecoderV1.

defaultEncoder( $value : mixed ) : array

It passes couchbase.encoder.* INI properties as $options.

Parameters
$value : mixed

document to be stored in the Couchbase

Tags
see
see
Return values
array

Array with three values: [bytes, flags, datatype]

basicDecoderV1()

Decodes value according to Common Flags (RFC-20)

basicDecoderV1( $bytes : string , $flags : int , $datatype : int , $options : array ) : mixed
Parameters
$bytes : string

Binary string received from the Couchbase, which contains encoded document

$flags : int

Flags which describes document encoding

$datatype : int

Extra field for datatype (not used at the moment)

$options : array
Tags
see

RFC-20 at SDK RFCs repository

Return values
mixed

Decoded document object

basicEncoderV1()

Encodes value according to Common Flags (RFC-20)

basicEncoderV1( $value : mixed , $options : array ) : array
Parameters
$value : mixed

document to be stored in the Couchbase

$options : array

Encoder options (see detailed description in INI section)

  • "sertype" (default: \Couchbase::ENCODER_FORMAT_JSON) encoding format to use
  • "cmprtype" (default: \Couchbase::ENCODER_COMPRESSION_NONE) compression type
  • "cmprthresh" (default: 0) compression threshold
  • "cmprfactor" (default: 0) compression factor
Tags
see

RFC-20 at SDK RFCs repository

Return values
array

Array with three values: [bytes, flags, datatype]

Search results