Batches
The /batches route allows you to monitor how Meilisearch is grouping and processing asynchronous operations.
The /batches
route gives information about the progress of batches of asynchronous operations.
Batch object
uid
Type: Integer
Description: Unique sequential identifier of the batch. Starts at 0
and increases by one for every new batch.
details
Type: Object
Description: Basic information on the types tasks in a batch. Consult the task object reference for an exhaustive list of possible values.
progress
Type: Object
Description: Object containing two fields: steps
and percentage
. Once Meilisearch has fully processed a batch, its progress
is set to null
.
steps
Information about the current operations Meilisearch is performing in this batch. A step may consist of multiple substeps.
Name | Description |
---|---|
currentStep | A string describing the operation |
total | The total number of operations in the step |
finished | The number of operations Meilisearch has completed |
If Meilisearch is taking longer than expected to process a batch, monitor the steps
array. If the finished
field of the last item in the steps
array does not update, Meilisearch may be stuck.
percentage
The percentage of completed operations, calculated from all current steps and substeps. This value is a rough estimate and may not always reflect the current state of the batch due to how different steps are processed more quickly than others.
stats
Type: Object
Description: Detailed information on the payload of all tasks in a batch.
totalNbTasks
Number of tasks in the batch.
status
Object listing the status of each task in the batch. Contains five keys whose values correspond to the number of tasks with that status.
types
List with the types
of tasks contained in the batch.
indexUids
List of the number of tasks in the batch separated by the indexes they affect.
progressTrace
List with full paths for each operation performed in the batch, together with the processing time in human-readable format.
writeChannelCongestion
Object containing information on write operations computed during indexing. Can be useful when diagnosing performance issues associated with write speeds.
internalDatabaseSizes
Size of each internal database, including by how much it changed after a batch was processed.
duration
Type: String
Description: The total elapsed time the batch spent in the processing
state, in ISO 8601 format. Set to null
while the batch is processing tasks
startedAt
Type: String
Description: The date and time when the batch began processing
, in RFC 3339 format
finishedAt
Type: String
Description: The date and time when the tasks finished processing
, whether failed
, succeeded
, or canceled
, in RFC 3339 format
Get batches
List all batches, regardless of index. The batch objects are contained in the results
array.
Batches are always returned in descending order of uid
. This means that by default, the most recently created batch objects appear first.
Batch results are paginated and can be filtered with query parameters.
Some query parameters for /batches
, such as uids
and statuses
, target tasks instead of batches.
For example, ?uids=0
returns a batch containing the task with a taskUid
equal to 0
, instead of a batch with a batchUid
equal to 0
.
Query parameters
Query Parameter | Default Value | Description |
---|---|---|
uids | * (all task uids) | Select batches containing the tasks with the specified uid s. Separate multiple task uids with a comma (, ) |
batchUids | * (all batch uids) | Filter batches by their uid . Separate multiple batch uids with a comma (, ) |
indexUids | * (all indexes) | Select batches containing tasks affecting the specified indexes. Separate multiple indexUids with a comma (, ) |
statuses | * (all statuses) | Select batches containing tasks with the specified status . Separate multiple task statuses with a comma (, ) |
types | * (all types) | Select batches containing tasks with the specified type . Separate multiple task types with a comma (, ) |
limit | 20 | Number of batches to return |
from | uid of the last created batch | uid of the first batch returned |
reverse | false | If true , returns results in the reverse order, from oldest to most recent |
beforeEnqueuedAt | * (all tasks) | Select batches containing tasks with the specified enqueuedAt field |
beforeStartedAt | * (all tasks) | Select batches containing tasks with the specified startedAt field |
beforeFinishedAt | * (all tasks) | Select batches containing tasks with the specified finishedAt field |
afterEnqueuedAt | * (all tasks) | Select batches containing tasks with the specified enqueuedAt field |
afterStartedAt | * (all tasks) | Select batches containing tasks with the specified startedAt field |
afterFinishedAt | * (all tasks) | Select batches containing tasks with the specified finishedAt field |
Response
Name | Type | Description |
---|---|---|
results | Array | An array of batch objects |
total | Integer | Total number of batches matching the filter or query |
limit | Integer | Number of batches returned |
from | Integer | uid of the first batch returned |
next | Integer | Value passed to from to view the next “page” of results. When the value of next is null , there are no more tasks to view |
Example
Response: 200 Ok
Get one batch
Get a single batch.
Path parameters
Name | Type | Description |
---|---|---|
batch_uid * | String | uid of the requested batch |