Skip to main content
PATCH
/
indexes
/
{indexUid}
/
settings
/
chat
cURL
curl \
  -X PATCH 'MEILISEARCH_URL/indexes/INDEX_NAME/settings/chat' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "description": "An index of movies.",
    "documentTemplate": "A movie titled '{{doc.title}}' released in {{ doc.release_date }}",
    "documentTemplateMaxBytes": 400
  }'
{
  "taskUid": 147,
  "indexUid": "movies",
  "status": "enqueued",
  "type": "settingsUpdate",
  "enqueuedAt": "2024-08-08T17:05:55.791772Z"
}

Authorizations

Authorization
string
header
required

An API key is a token that you provide when making API calls. Read more about how to secure your project.

Include the API key to the Authorization header, for instance:

-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'

If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:

const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});

Path Parameters

indexUid
string
required

Unique identifier of the index.

Body

application/json

Configuration settings for AI-powered chat and search functionality.

These settings control how documents are presented to the LLM and what search parameters are used when the LLM queries the index.

description
string | null

A description of this index that helps the LLM understand its contents and purpose. This description is provided to the LLM to help it decide when and how to query this index. Example: "Contains product catalog with prices and descriptions".

documentTemplate
string | null

A liquid template used to render documents to a text that can be embedded.

Meillisearch interpolates the template for each document and sends the resulting text to the embedder. The embedder then generates document vectors based on this text.

documentTemplateMaxBytes
integer | null

Maximum size in bytes for the rendered document text. Texts longer than this limit are truncated. This prevents very large documents from consuming too much context in the LLM conversation. Defaults to 400 bytes.

Required range: x >= 0
searchParameters
object

Default search parameters used when the LLM queries this index. These settings control how search results are retrieved and ranked. If not specified, standard search defaults are used.

Response

Task successfully enqueued.

A summarized view of a task, returned when a task is enqueued

taskUid
integer<u-int32>
required

Unique sequential identifier of the task.

Required range: x >= 0
status
enum<string>
required

Status of the task. Possible values are enqueued, processing, succeeded, failed, and canceled.

Available options:
enqueued,
processing,
succeeded,
failed,
canceled
Example:

"processing"

type
enum<string>
required

Type of operation performed by the task.

Available options:
documentAdditionOrUpdate,
documentEdition,
documentDeletion,
settingsUpdate,
indexCreation,
indexDeletion,
indexUpdate,
indexSwap,
taskCancelation,
taskDeletion,
dumpCreation,
snapshotCreation,
export,
upgradeDatabase,
indexCompaction,
networkTopologyChange
Example:

"documentAdditionOrUpdate"

enqueuedAt
string<date-time>
required

Date and time when the task was enqueued.

indexUid
string | null

Unique identifier of the targeted index. Null for global tasks.

customMetadata
string | null

Custom metadata attached to this task at creation. Use it to associate tasks with external systems or add application-specific information.