Documentation

SearchIndex
in package
implements JsonSerializable

Interfaces, Classes, Traits and Enums

JsonSerializable

Table of Contents

$name  : string
$params  : stdClass|null
$planParams  : stdClass|null
$sourceName  : string
$sourceParams  : stdClass|null
$sourceType  : string
$sourceUuid  : string|null
$type  : string
$uuid  : string|null
__construct()  : mixed
build()  : SearchIndex
Static helper to keep code more readable
name()  : string
Get the name of the index
params()  : stdClass|null
Get the params of index
planParams()  : stdClass|null
Get the plan params of index
setName()  : $this
Sets the name of the index
setParams()  : $this
Sets the params on index. Either as JSON string or decoded into array/stdClass
setPlanParams()  : $this
Sets plan params of index. Either as JSON string or decoded as array/stdClass.
setSourceName()  : $this
Sets bucket name on index
setSourceParams()  : $this
Sets source params of index. Either as JSON string or decoded into array/stdClass
setSourceType()  : $this
Sets source type on index. Defaults to 'couchbase'
setSourceUuid()  : $this
Sets Bucket UUID on index
setType()  : $this
Sets the type of the index. Defaults to 'fulltext-index'
setUuid()  : $this
Sets the UUID of the index.
sourceName()  : string
Get the bucket name on index
sourceParams()  : stdClass|null
Get the source params of index
sourceType()  : string
Get the source type of index. Defaults to 'couchbase'
sourceUuid()  : string|null
Get the UUID of the bucket on index
type()  : string
Get the type of index. Defaults to 'fulltext-index'
uuid()  : string|null
Get the UUID of index
standardiseImportedIndex()  : stdClass
Standardises imported index to match with what is returned by the core, converts to stdClass as it is avoids ambiguity with array/object json conversions
toObject()  : mixed
Converts array to stdObject, which makes it easier to work with json_encode

Properties

$planParams

private stdClass|null $planParams = null

$sourceParams

private stdClass|null $sourceParams = null

$sourceType

private string $sourceType = "couchbase"

Methods

__construct()

public __construct(string $indexName, string $sourceName) : mixed
Parameters
$indexName : string

the name of the index

$sourceName : string

the name of the bucket where you want to create the index

Tags
since
4.1.5
Return values
mixed

build()

Static helper to keep code more readable

public static build(string $indexName, string $sourceName) : SearchIndex
Parameters
$indexName : string

the name of the index

$sourceName : string

the name of the bucket where you want to create the index

Tags
since
4.1.5
Return values
SearchIndex

name()

Get the name of the index

public name() : string
Tags
since
4.1.5
Return values
string

params()

Get the params of index

public params() : stdClass|null
Tags
since
4.1.5
Return values
stdClass|null

planParams()

Get the plan params of index

public planParams() : stdClass|null
Tags
since
4.1.5
Return values
stdClass|null

setName()

Sets the name of the index

public setName(string $name) : $this
Parameters
$name : string
Tags
since
4.1.5
Return values
$this

setParams()

Sets the params on index. Either as JSON string or decoded into array/stdClass

public setParams(string|array<string|int, mixed>|stdClass $params) : $this
Parameters
$params : string|array<string|int, mixed>|stdClass
Tags
since
4.1.5
Return values
$this

setPlanParams()

Sets plan params of index. Either as JSON string or decoded as array/stdClass.

public setPlanParams(string|array<string|int, mixed>|stdClass $planParams) : $this
Parameters
$planParams : string|array<string|int, mixed>|stdClass
Tags
since
4.1.5
Return values
$this

setSourceName()

Sets bucket name on index

public setSourceName(string $sourceName) : $this
Parameters
$sourceName : string
Tags
since
4.1.5
Return values
$this

setSourceParams()

Sets source params of index. Either as JSON string or decoded into array/stdClass

public setSourceParams(string|array<string|int, mixed>|stdClass $sourceParams) : $this
Parameters
$sourceParams : string|array<string|int, mixed>|stdClass
Tags
since
4.1.5
Return values
$this

setSourceType()

Sets source type on index. Defaults to 'couchbase'

public setSourceType(string $type) : $this
Parameters
$type : string
Tags
since
4.1.5
Return values
$this

setSourceUuid()

Sets Bucket UUID on index

public setSourceUuid(string $uuid) : $this
Parameters
$uuid : string
Tags
since
4.1.5
Return values
$this

setType()

Sets the type of the index. Defaults to 'fulltext-index'

public setType(string $type) : $this
Parameters
$type : string
Tags
since
4.1.5
Return values
$this

setUuid()

Sets the UUID of the index.

public setUuid(string $uuid) : $this
Parameters
$uuid : string
Tags
since
4.1.5
Return values
$this

sourceName()

Get the bucket name on index

public sourceName() : string
Tags
since
4.1.5
Return values
string

sourceParams()

Get the source params of index

public sourceParams() : stdClass|null
Tags
since
4.1.5
Return values
stdClass|null

sourceType()

Get the source type of index. Defaults to 'couchbase'

public sourceType() : string
Tags
since
4.1.5
Return values
string

sourceUuid()

Get the UUID of the bucket on index

public sourceUuid() : string|null
Tags
since
4.1.5
Return values
string|null

type()

Get the type of index. Defaults to 'fulltext-index'

public type() : string
Tags
since
4.1.5
Return values
string

uuid()

Get the UUID of index

public uuid() : string|null
Tags
since
4.1.5
Return values
string|null

standardiseImportedIndex()

Standardises imported index to match with what is returned by the core, converts to stdClass as it is avoids ambiguity with array/object json conversions

private static standardiseImportedIndex(stdClass|array<string|int, mixed> $searchIndex) : stdClass
Parameters
$searchIndex : stdClass|array<string|int, mixed>
Tags
since
4.1.5
Return values
stdClass

toObject()

Converts array to stdObject, which makes it easier to work with json_encode

private static toObject(array<string|int, mixed> $arr) : mixed
Parameters
$arr : array<string|int, mixed>
Tags
since
4.1.5
Return values
mixed

        

Search results