Delete documents
Delete a selection of documents based on a filter.
Headers
-
Content-Type string Required
Payload content-type
Value is
application/json
.
Path parameters
-
indexUid string Required
Index Unique Identifier
Body Required
- filter array[string] | string | array[array | string]
One of: Attribute(s) to filter on.
Can be made of 3 syntaxes
- Nested Array:
["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
- String:
"something > 1 AND genres=comedy AND (genres=horror OR title=batman)"
- Mixed:
["something > 1 AND genres=comedy", "genres=horror OR title=batman"]
_geoRadius({lat}, {lng}, {distance_in_meters}) and _geoBoundingBox([{lat, lng}], [{lat}, {lng}]) built-in filter rules can be used to filter documents within geo shapes.
Attribute(s) used in
filter
should be declared as filterable attributes. See Filtering and Faceted Search.Format of each should match the following pattern:
^[^:]+:[^:]+$
.Attribute(s) to filter on.
Can be made of 3 syntaxes
- Nested Array:
["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
- String:
"something > 1 AND genres=comedy AND (genres=horror OR title=batman)"
- Mixed:
["something > 1 AND genres=comedy", "genres=horror OR title=batman"]
_geoRadius({lat}, {lng}, {distance_in_meters}) and _geoBoundingBox([{lat, lng}], [{lat}, {lng}]) built-in filter rules can be used to filter documents within geo shapes.
Attribute(s) used in
filter
should be declared as filterable attributes. See Filtering and Faceted Search.Format should match the following pattern:
^[^:]+:[^:]+$
.Attribute(s) to filter on.
Can be made of 3 syntaxes
- Nested Array:
["something > 1", "genres=comedy", ["genres=horror", "title=batman"]]
- String:
"something > 1 AND genres=comedy AND (genres=horror OR title=batman)"
- Mixed:
["something > 1 AND genres=comedy", "genres=horror OR title=batman"]
_geoRadius({lat}, {lng}, {distance_in_meters}) and _geoBoundingBox([{lat, lng}], [{lat}, {lng}]) built-in filter rules can be used to filter documents within geo shapes.
Attribute(s) used in
filter
should be declared as filterable attributes. See Filtering and Faceted Search. - Nested Array:
curl \
-X POST https://example.meilisearch.com:7700/indexes/movies/documents/delete \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"offset":2,"limit":5,"fields":["name","picture"],"filter":"doggo = \"bernese mountain\""}'
# Headers
Content-Type: application/json
# Payload
{
"offset": 2,
"limit": 5,
"fields": [
"name",
"picture"
],
"filter": "doggo = \"bernese mountain\""
}
{
"taskUid": 0,
"indexUid": "movies",
"status": "enqueued",
"type": "documentDeletion",
"enqueuedAt": "2021-01-01T09:39:00.000000Z"
}
{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}