Meilisearch PHP | Documentation

HandlesDocuments

Table of Contents

Methods

addDocuments()  : mixed
addDocumentsCsv()  : mixed
addDocumentsCsvInBatches()  : mixed
addDocumentsInBatches()  : mixed
addDocumentsJson()  : mixed
addDocumentsNdjson()  : mixed
addDocumentsNdjsonInBatches()  : mixed
deleteAllDocuments()  : array<string|int, mixed>
deleteDocument()  : array<string|int, mixed>
deleteDocuments()  : array<string|int, mixed>
getDocument()  : mixed
getDocuments()  : DocumentsResults
updateDocuments()  : mixed
updateDocumentsByFunction()  : mixed
This is an EXPERIMENTAL feature, which may break without a major version.
updateDocumentsCsv()  : mixed
updateDocumentsCsvInBatches()  : mixed
updateDocumentsInBatches()  : mixed
updateDocumentsJson()  : mixed
updateDocumentsNdjson()  : mixed
updateDocumentsNdjsonInBatches()  : mixed
assertValidDocumentId()  : void
batch()  : Generator
batchCsvString()  : Generator
batchNdjsonString()  : Generator

Methods

addDocuments()

public addDocuments(array<string|int, mixed> $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : array<string|int, mixed>
$primaryKey : string|null = null

addDocumentsCsv()

public addDocumentsCsv(string $documents[, string|null $primaryKey = null ][, string|null $delimiter = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null
$delimiter : string|null = null

addDocumentsCsvInBatches()

public addDocumentsCsvInBatches(string $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ][, string|null $delimiter = null ]) : mixed
Parameters
$documents : string
$batchSize : int|null = 1000
$primaryKey : string|null = null
$delimiter : string|null = null

addDocumentsInBatches()

public addDocumentsInBatches(array<string|int, mixed> $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ]) : mixed
Parameters
$documents : array<string|int, mixed>
$batchSize : int|null = 1000
$primaryKey : string|null = null

addDocumentsJson()

public addDocumentsJson(string $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null

addDocumentsNdjson()

public addDocumentsNdjson(string $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null

addDocumentsNdjsonInBatches()

public addDocumentsNdjsonInBatches(string $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$batchSize : int|null = 1000
$primaryKey : string|null = null

deleteAllDocuments()

public deleteAllDocuments() : array<string|int, mixed>
Return values
array<string|int, mixed>

deleteDocument()

public deleteDocument(mixed $documentId) : array<string|int, mixed>
Parameters
$documentId : mixed
Return values
array<string|int, mixed>

deleteDocuments()

public deleteDocuments(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Return values
array<string|int, mixed>

getDocument()

public getDocument(mixed $documentId[, array<string|int, mixed>|null $fields = null ]) : mixed
Parameters
$documentId : mixed
$fields : array<string|int, mixed>|null = null

updateDocuments()

public updateDocuments(array<string|int, mixed> $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : array<string|int, mixed>
$primaryKey : string|null = null

updateDocumentsByFunction()

This is an EXPERIMENTAL feature, which may break without a major version.

public updateDocumentsByFunction(non-empty-string $function[, array{filter?: non-empty-string|list|null, context?: array$options = [] ]) : mixed

It's available after Meilisearch v1.10.

More info about the feature: https://github.com/orgs/meilisearch/discussions/762 More info about experimental features in general: https://www.meilisearch.com/docs/reference/api/experimental-features

Parameters
$function : non-empty-string
$options : array{filter?: non-empty-string|list|null, context?: array} = []

updateDocumentsCsv()

public updateDocumentsCsv(string $documents[, string|null $primaryKey = null ][, string|null $delimiter = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null
$delimiter : string|null = null

updateDocumentsCsvInBatches()

public updateDocumentsCsvInBatches(string $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ][, string|null $delimiter = null ]) : mixed
Parameters
$documents : string
$batchSize : int|null = 1000
$primaryKey : string|null = null
$delimiter : string|null = null

updateDocumentsInBatches()

public updateDocumentsInBatches(array<string|int, mixed> $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ]) : mixed
Parameters
$documents : array<string|int, mixed>
$batchSize : int|null = 1000
$primaryKey : string|null = null

updateDocumentsJson()

public updateDocumentsJson(string $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null

updateDocumentsNdjson()

public updateDocumentsNdjson(string $documents[, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$primaryKey : string|null = null

updateDocumentsNdjsonInBatches()

public updateDocumentsNdjsonInBatches(string $documents[, int|null $batchSize = 1000 ][, string|null $primaryKey = null ]) : mixed
Parameters
$documents : string
$batchSize : int|null = 1000
$primaryKey : string|null = null

assertValidDocumentId()

private assertValidDocumentId(mixed $documentId) : void
Parameters
$documentId : mixed

batch()

private static batch(array<string|int, mixed> $documents, int $batchSize) : Generator
Parameters
$documents : array<string|int, mixed>
$batchSize : int
Return values
Generator

batchCsvString()

private static batchCsvString(string $documents, int $batchSize) : Generator
Parameters
$documents : string
$batchSize : int
Return values
Generator

batchNdjsonString()

private static batchNdjsonString(string $documents, int $batchSize) : Generator
Parameters
$documents : string
$batchSize : int
Return values
Generator

        
On this page

Search results