v6

OpenAPI 3.1.0Apache-2.0raw.githubusercontent.com2026-08-011951192.5 KB
Document

Delete Document(s) by Request Object

Delete document by document_id, by array of document_id (bulk), by query (SearchRequestObject) from index with index_id, or clear all documents from index. Immediately effective, independent of commit. Index space used by deleted documents is not reclaimed (until compaction is implemented), but result_count_total is updated. By manually deleting the delete.bin file the deleted documents can be recovered (until compaction). Deleted documents impact performance, especially but not limited to counting (Count, TopKCount). They also increase the size of the index (until compaction is implemented). For minimal query latency delete index and reindexing documents is preferred over deleting documents (until compaction is implemented). BM25 scores are not updated (until compaction is implemented), but the impact is minimal. Document ID can by obtained by search. When deleting by query (SearchRequestObject), it is advised to perform a dry run search first, to see which documents will be deleted.

delete/api/v1/index/{index_id}/doc

Path parameters

index_idinteger required

index id

Headers

apikeystring required

YOUR_SECRET_API_KEY

Request body

querystring required

Query string, search operators + - "" are recognized.

{"stackTrail":"components:schemas:SearchRequestObject:properties:query_vector","oasType":"schema","type":"unknown","description":"Optional query vector: If None, then the query vector is derived from the query string using the specified model. If Some, then the query vector is used for semantic search and the query string is only used for lexical search and highlighting."}
enable_empty_queryboolean

Enable empty query: if true, an empty query string iterates through all indexed documents, supporting the query parameters: offset, length, query_facets, facet_filter, result_sort, otherwise an empty query string returns no results. Typical use cases include index browsing, index export, conversion, analytics, audits, and inspection.

offsetinteger

Offset of search results to return.

lengthinteger

Number of search results to return.

result_type'Count' | 'Topk' | 'TopkCount'

The following result types are supported:

  • Count (count all results that match the query, but returning top-k results is not required)
  • Topk (returns the top-k results per query, but counting all results that match the query is not required)
  • TopkCount (returns the top-k results per query + count all results that match the query)
realtimeboolean

True realtime search: include indexed, but uncommitted documents into search results.

field_filterstring[]

Specify field names where to search at querytime, whereas SchemaField.indexed is set at indextime. If empty then all indexed fields are searched.

fieldsstring[]

Specify names of fields to return in the search results, where SchemaField.store is set at indextime. If empty then all stored fields are returned.

query_type_default'Union' | 'Intersection' | 'Phrase' | 'Not'

Specifies the default QueryType: The following query types are supported:

  • Union (OR, disjunction),
  • Intersection (AND, conjunction),
  • Phrase (""),
  • Not (-).

The default QueryType is superseded if the query parser detects that a different query type is specified within the query string (+ - "").

Example request

{
  "length": 10,
  "field_filter": [
    "title"
  ],
  "result_sort": [
    {
      "field": "date",
      "order": "Ascending",
      "base": "None"
    }
  ]
}

Response

Document deleted, returns indexed documents count