Cancel Indexing

Cancel Indexing

This method allows you to cancel an indexing for a knowledge base index.

Depending on the number of documents to be processed, an indexing can take a significant amount of time. If you discover that the processing of documents is not happening as you expect (e.g., a data source linked to the knowledge base of the index is misconfigured, and documents fail to be downloaded), it may be useful to cancel the processing of any remaining documents.

This method allows to do so, which stops the crawling of documents from all data sources linked to the knowledge base of the index (unless the crawling phase is already complete), it stops the processing of any documents that have not yet been processed, and the backend marks each such document with status=CANCELLED.

Note that cancelling is not immediate, as any pending document needs to updated as described above. For very large knowledge bases, even cancellation may take several minutes.

Once an indexing is cancelled and any remaining processing has been completed, the indexing status is updated according, and you can trigger a new indexing.

This method also allows forcing the immediate cancellation of an indexing, which merely marks an indexing as cancelled, which allows you to trigger a new indexing. You should never require to force-cancel an indexing, and you should always perform a "regular" cancellation prior to forcing it. Only use a forced cancellation if instructed to do so by PAIS support.

Request
URI
POST
https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/indexings/{indexing_id}/cancel
COPY
Path Parameters
string
knowledge_base_id
Required

knowledge_base_id

string
index_id
Required

index_id

string
indexing_id
Required

indexing_id

Query Parameters
boolean
force
Optional
Constraints: default: false

force


Authentication
This operation uses the following authentication methods.
Responses
202

Successful Response

Returns Indexing of type(s) application/json
{
    "id": "string",
    "created_at": 0,
    "knowledge_base_id": "string",
    "index_id": "string",
    "completed_at": 0
}
string As uuid As uuid
id
Required

ID of the indexing.

state
Required

State of the indexing.

integer
created_at
Required

Unix timestamp (in seconds) when the indexing was created.

string As uuid As uuid
knowledge_base_id
Required

The ID of the knowledge base that is being indexed.

string As uuid As uuid
index_id
Required

The ID of the index that is being indexed.

integer
completed_at
Optional

Unix timestamp (in seconds) when the indexing completed.


404

Invalid knowledge base, index or indexing ID.

Operation doesn't return any data structure

422

Validation Error

Returns HTTPValidationError of type(s) application/json
"HTTPValidationError Object"
array of object
detail
Optional

detail


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/indexings/{indexing_id}/cancel