For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Reference

API wrapper documentation for the BoxLang Meilisearch module.

Indexes

List indexes

List all indexes with pagination and filtering options.

var result = meilisearch()
	.indexes()
	.list();

🔗 Meilisearch: List All Indexes

Swap indexes

Swap two indexes for zero-downtime deployments.

meilisearch()
	.indexes()
	.swap( [ "books", "books_staging" ] );

🔗 Meilisearch: Swap Indexes

Get stats

Get database and index statistics including document counts and sizes.

🔗 Meilisearch: Get Stats

Single Index

Get an index

Retrieve a single index by its unique identifier.

🔗 Meilisearch: Get One Index

Create an index

Create a new index with an optional primary key.

🔗 Meilisearch: Create an Index

Get Index stats

Get index statistics.

🔗 Meilisearch: Get stats of an index

Compact an index

Compact an index to reduce database fragmentation.

🔗 Meilisearch: Compact an Index

Delete an index

Permanently delete an index and all its documents.

🔗 Meilisearch: Delete an Index

Documents

Add or Replace Documents

Add or replace documents in an index. Replaces existing documents with the same primary key.

🔗 Meilisearch: Add or Replace Documents

Add or Update Documents

Add or update documents in an index. Updates existing documents instead of replacing them entirely.

🔗 Meilisearch: Add or Update Documents

Delete All Documents

Delete all documents from an index.

🔗 Meilisearch: Delete All Documents

Get Documents

Retrieve documents from an index with optional filtering.

🔗 Meilisearch: Get Documents

Get Single Document

Retrieve a specific document by its ID.

🔗 Meilisearch: Get One Document

Delete Single Document

Delete a specific document by its ID.

🔗 Meilisearch: Delete One Document

The Search DSL provides a fluent interface for querying documents in an index. It supports both POST (default) and GET request methods.

Search for documents using a query string.

🔗 Meilisearch: Search Documents

Search with parameters

Pass initial parameters as the second argument to search().

🔗 Meilisearch: Search Parameters

Fluent DSL with chained methods

Chain parameter methods for a readable, builder-style interface.

Any Meilisearch search parameter can be used as a method call. The method name becomes the parameter name, and the method value becomes the parameter value.

Common parameters:

  • filter - Filter results using Meilisearch filter expressions

  • limit - Maximum number of results to return

  • offset - Number of results to skip (for pagination)

  • attributesToRetrieve - Comma-separated list of fields to return

  • sort - Sort order (e.g., "price:asc")

  • facets - Facets to compute

🔗 Meilisearch: Search Parameters

Search with GET request

Use sendWithGet() instead of send() to make a GET request instead of POST.

🔗 Meilisearch: Search with GET

Facets

The Facets API allows you to search for facet values using AI-powered prefix search and typo tolerance.

Note: This endpoint requires attributes to be added to filterableAttributes in index settings first.

Search for facet values within a given facet.

🔗 Meilisearch: Facet Search

Keys

List API keys

List all API keys with optional pagination.

🔗 Meilisearch: Get Keys

Get an API key

Retrieve a single API key by its UID or key value.

🔗 Meilisearch: Get Key

Update an API key

Update an existing API key's name or description.

🔗 Meilisearch: Update Key

Delete an API key

Permanently delete an API key.

🔗 Meilisearch: Delete Key

Settings

List settings

Retrieve the complete settings configuration for an index.

🔗 Meilisearch: Get Settings

Update settings

Update index settings including ranking rules, searchable attributes, and more.

🔗 Meilisearch: Update Settings

Reset settings

Reset all index settings to their default values.

🔗 Meilisearch: Reset Settings

Tasks

List tasks

List all asynchronous tasks with filtering and pagination options.

🔗 Meilisearch: Get Tasks

Get a task

Retrieve a single task by its unique identifier.

🔗 Meilisearch: Get Task

Cancel tasks

Cancel enqueued or processing tasks.

🔗 Meilisearch: Cancel Tasks

Delete tasks

Delete tasks matching specific criteria.

🔗 Meilisearch: Delete Tasks

Batches

The Batches API allows you to monitor how Meilisearch groups and processes asynchronous operations. Batches show the progress of grouped tasks.

List batches

List all batches with filtering and pagination options.

🔗 Meilisearch: Get Batches

Get a batch

Retrieve a single batch by its unique identifier.

🔗 Meilisearch: Get One Batch

Webhooks

The Webhooks API allows you to trigger automatic workflows when Meilisearch finishes processing tasks. When a task completes, Meilisearch sends the task object to all configured webhooks.

Note: You can create up to 20 webhooks. Having multiple webhooks active at the same time may negatively impact performance.

List webhooks

List all configured webhooks.

🔗 Meilisearch: Get Webhooks

Create a webhook

Create a new webhook to receive task completion notifications.

🔗 Meilisearch: Create Webhook

Get a webhook

Retrieve a single webhook by its UUID.

🔗 Meilisearch: Get Webhook

Update a webhook

Update a webhook's configuration. To remove a field, set its value to null.

🔗 Meilisearch: Update Webhook

Delete a webhook

Delete a webhook to stop receiving task completion notifications.

🔗 Meilisearch: Delete Webhook

Task Object

Every asynchronous operation in Meilisearch (index creation, document updates, index swaps, etc.) returns a Task object. This object provides methods to track the operation's progress and wait for completion.

Understanding Tasks

Meilisearch operations are asynchronous - when you create an index or add documents, Meilisearch creates a Task to track that operation while it continues in the background. You use the Task object to:

  1. Check the current status of the operation

  2. Wait for the operation to complete

  3. Get detailed information about the operation result

Example: Creating an Index with Task Tracking

Task.getStatus()

Get the current status of the task.

Possible values:

  • enqueued - Task is in the queue, waiting to be processed

  • processing - Task is currently being processed

  • succeeded - Task completed successfully

  • failed - Task failed (check getError() for details)

  • canceled - Task was canceled

Task.getType()

Get the type of operation this task represents.

Common types:

  • indexCreation - Creating a new index

  • indexUpdate - Updating an index

  • indexDeletion - Deleting an index

  • documentAdditionOrUpdate - Adding or updating documents

  • documentDeletion - Deleting documents

  • indexSwap - Swapping two indexes

  • settingsUpdate - Updating index settings

Task.toStruct()

Convert the Task object to a plain struct with all task data.

Task.waitForCompletion( interval )

Wait for the task to complete by polling at regular intervals.

Parameters:

  • interval (integer) - Number of milliseconds to wait between polls (default: 1000)

  • timeout (integer) - Maximum time to wait for task completion in milliseconds (default: 30000)

Returns: A new Task object with the final task status

Note: The original Task object is not modified; waitForCompletion() returns a new Task instance with updated data.

Additional Task Getters

Experimental Features

List experimental features

List all available experimental features and their current status.

🔗 Meilisearch: Get Experimental Features

Get an experimental feature

Retrieve the status of a specific experimental feature.

🔗 Meilisearch: Get One Experimental Feature

Enable/disable an experimental feature

Enable or disable a specific experimental feature.

🔗 Meilisearch: Update Experimental Features

Set multiple experimental features

Enable or disable multiple experimental features at once.

🔗 Meilisearch: Update Experimental Features

Snapshots

Create a snapshot

Create a snapshot of the Meilisearch instance for backup purposes.

🔗 Meilisearch: Create Snapshot

Network

The Network API allows you to create a network of Meilisearch instances for federated search and horizontal database partitioning strategies like sharding.

Note: This is an experimental feature. Enable it first using the experimental features endpoint.

Get network configuration

Retrieve the current network configuration including self instance name, sharding status, and remote instances.

🔗 Meilisearch: Get Network

Update network configuration

Update the network configuration. Updates are partial - only provide the fields you want to update.

🔗 Meilisearch: Update Network

Similar Documents

The Similar Documents API uses AI-powered search to find documents similar to a specific document. This requires the document to have vector embeddings generated by a configured embedder.

Note: This endpoint requires an embedder to be configured in the index settings first.

Get similar documents

Find documents similar to a target document using POST or GET requests.

🔗 Meilisearch: Similar Documents

Health Check

Check instance health

Check if the Meilisearch instance is available and responding.

🔗 Meilisearch: Health

Version

Get instance version

Retrieve the version information of the Meilisearch instance.

🔗 Meilisearch: Version

Last updated

Was this helpful?