Documents are the individual items that make up a dataset. Each document is an object composed of one or more fields.
_geo
field.Reserved attributes are always prefixed with an underscore (_
).http-payload-size-limit
option.
Meilisearch uses a lot of RAM when indexing documents. Be aware of your RAM availability as you increase your batch size as this could cause Meilisearch to crash.
When using the add new documents endpoint, ensure:
application/json
content-type header.
As an example, let’s say you are creating an index that contains information about movies. A sample document might look like this:
"id"
, "title"
, "genres"
, "release-year"
, and "cast"
are attributes"Kung Fu Panda"
is the value of "title"
"id": "1564"
application/x-ndjson
content-type header.
Compared to JSON, NDJSON has better writing performance and is less CPU and memory intensive. It is easier to validate and, unlike CSV, can handle nested structures.
The above JSON document would look like this in NDJSON:
string
, boolean
, and number
data types for CSV documents. If you don’t specify the data type for an attribute, it will default to string
. Empty fields such as ,,
and , ,
will be considered null
.
By default, Meilisearch uses a single comma (,
) as the delimiter. Use the csvDelimiter
query parameter with the add or update documents or add or replace documents endpoints to set a different character. Any rules that apply to formatting CSV also apply to Meilisearch documents.
Meilisearch will only accept CSV documents when it receives the text/csv
content-type header.
Compared to JSON, CSV has better writing performance and is less CPU and memory intensive.
The above JSON document would look like this in CSV:
cast
cannot be converted to CSV.
startedAt
, finishedAt
, and duration
.
If a task fails due to an invalid document, it will be removed from the batch. The rest of the batch will still process normally. If an internal
error occurs, the whole batch will fail and all tasks within it will share the same error
object.