Meilisearch PHP | Documentation

Client
in package
uses HandlesChatWorkspaces, HandlesDumps, HandlesIndex, HandlesTasks, HandlesKeys, HandlesSnapshots, HandlesSystem, HandlesMultiSearch, HandlesBatches, HandlesNetwork, HandlesDynamicSearchRules

Table of Contents

Properties

$batches  : Batches
$chats  : ChatWorkspaces
$dumps  : Dumps
$dynamicSearchRules  : DynamicSearchRules
$health  : Health
$http  : Http
$index  : Indexes
$keys  : Keys
$network  : Network
$snapshots  : Snapshots
$stats  : Stats
$tasks  : Tasks
$tenantToken  : TenantToken
$version  : Version

Methods

__construct()  : mixed
addRemote()  : Task
Add a remote to the network.
addRemotesToShard()  : Task
cancelTasks()  : Task
chatWorkspace()  : ChatWorkspaces
Get a specific chat workspace instance.
compactIndex()  : Task
createDump()  : Task
createIndex()  : Task
createKey()  : Key
createSnapshot()  : Task
deleteAllDynamicSearchRules()  : Task
Delete all dynamic search rules.
deleteDynamicSearchRule()  : Task
Delete a dynamic search rule.
deleteIndex()  : Task
deleteKey()  : void
deleteTasks()  : Task
generateTenantToken()  : string
getBatch()  : Batch
getBatches()  : BatchesResults
getChatWorkspaces()  : ChatWorkspacesResults
List all chat workspaces.
getDynamicSearchRule()  : DynamicSearchRule
Get a dynamic search rule.
getDynamicSearchRules()  : DynamicSearchRulesResults
List dynamic search rules.
getIndex()  : Index
getIndexes()  : IndexesResults
getKey()  : Key
getKeys()  : KeysResults
getNetwork()  : NetworkResults
getRawIndex()  : array{uid: non-empty-string, primaryKey: string|null, createdAt: non-empty-string, updatedAt: non-empty-string}
getRawKeys()  : RawKeys
getTask()  : Task
getTaskDocuments()  : StreamInterface
getTasks()  : TasksResults
health()  : Health
index()  : Index
initializeNetwork()  : Task
Initialize a network with the current instance as leader.
isHealthy()  : bool
multiSearch()  : array<string|int, mixed>
Pass `$includeMetadata` to send `Meili-Include-Metadata: true`. Available since Meilisearch v1.55.0.
removeRemote()  : Task
Remove a remote from the network.
removeRemotesFromShard()  : Task
renameIndex()  : Task
Rename an index instead of swapping it.
stats()  : Stats
swapIndexes()  : Task
updateDynamicSearchRule()  : Task
Create or update a dynamic search rule.
updateIndex()  : Task
updateKey()  : Key
version()  : Version

Properties

Methods

__construct()

public __construct(string $url[, string|null $apiKey = null ][, ClientInterface|null $httpClient = null ][, RequestFactoryInterface|null $requestFactory = null ][, array<int, string> $clientAgents = [] ][, StreamFactoryInterface|null $streamFactory = null ]) : mixed
Parameters
$url : string
$apiKey : string|null = null
$httpClient : ClientInterface|null = null
$requestFactory : RequestFactoryInterface|null = null
$clientAgents : array<int, string> = []
$streamFactory : StreamFactoryInterface|null = null

addRemote()

Add a remote to the network.

public addRemote(non-empty-string $name, RemoteConfig $remote) : Task
Parameters
$name : non-empty-string
$remote : RemoteConfig
Return values
Task

addRemotesToShard()

public addRemotesToShard(non-empty-string $shardName, array<int, non-empty-string> $remoteNames) : Task
Parameters
$shardName : non-empty-string
$remoteNames : array<int, non-empty-string>
Return values
Task

compactIndex()

public compactIndex(non-empty-string $uid) : Task
Parameters
$uid : non-empty-string
Return values
Task

createIndex()

public createIndex(non-empty-string $uid[, array{primaryKey?: string|null} $options = [] ]) : Task
Parameters
$uid : non-empty-string
$options : array{primaryKey?: string|null} = []
Return values
Task

deleteIndex()

public deleteIndex(non-empty-string $uid) : Task
Parameters
$uid : non-empty-string
Return values
Task

deleteKey()

public deleteKey(string $keyOrUid) : void
Parameters
$keyOrUid : string

generateTenantToken()

public generateTenantToken(string $apiKeyUid, array<string|int, mixed>|object $searchRules[, DateTimeInterface|null} $options = [] ]) : string
Parameters
$apiKeyUid : string
$searchRules : array<string|int, mixed>|object
$options : DateTimeInterface|null} = []
Return values
string

getIndex()

public getIndex(non-empty-string $uid) : Index
Parameters
$uid : non-empty-string
Return values
Index

getKey()

public getKey(non-empty-string $keyOrUid) : Key
Parameters
$keyOrUid : non-empty-string
Return values
Key

getRawIndex()

public getRawIndex(non-empty-string $uid) : array{uid: non-empty-string, primaryKey: string|null, createdAt: non-empty-string, updatedAt: non-empty-string}
Parameters
$uid : non-empty-string
Return values
array{uid: non-empty-string, primaryKey: string|null, createdAt: non-empty-string, updatedAt: non-empty-string}

getRawKeys()

public getRawKeys([array<string|int, mixed> $options = [] ]) : RawKeys
Parameters
$options : array<string|int, mixed> = []
Return values
RawKeys

getTaskDocuments()

public getTaskDocuments(int $uid) : StreamInterface
Parameters
$uid : int
Return values
StreamInterface

index()

public index(non-empty-string $uid) : Index
Parameters
$uid : non-empty-string
Return values
Index

initializeNetwork()

Initialize a network with the current instance as leader.

public initializeNetwork(ShardConfig>} $options) : Task
Parameters
$options : ShardConfig>}
Return values
Task

multiSearch()

Pass `$includeMetadata` to send `Meili-Include-Metadata: true`. Available since Meilisearch v1.55.0.

public multiSearch([array<int, MultiSearchQuery> $queries = [] ][, MultiSearchFederation|null $federation = null ][, bool $includeMetadata = false ]) : array<string|int, mixed>

Without federation, each item of results then includes metadata. With federation, metadata is a top-level list with one entry per query.

Parameters
$queries : array<int, MultiSearchQuery> = []
$federation : MultiSearchFederation|null = null
$includeMetadata : bool = false
Tags
see
https://www.meilisearch.com/docs/reference/api/multi-search/perform-a-multi-search
Return values
array<string|int, mixed>

removeRemote()

Remove a remote from the network.

public removeRemote(non-empty-string $name) : Task
Parameters
$name : non-empty-string
Return values
Task

removeRemotesFromShard()

public removeRemotesFromShard(non-empty-string $shardName, array<int, non-empty-string> $remoteNames) : Task
Parameters
$shardName : non-empty-string
$remoteNames : array<int, non-empty-string>
Return values
Task

updateIndex()

public updateIndex(non-empty-string $uid[, array{primaryKey?: string|null, uid?: non-empty-string} $options = [] ]) : Task
Parameters
$uid : non-empty-string
$options : array{primaryKey?: string|null, uid?: non-empty-string} = []
Return values
Task
On this page

Search results