Create Indexing

Create Indexing

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

As part of an indexing, all data sources linked to the knowledge base of the index are crawled, and any previously-unseed documents are downloaded, they are added to the index, and are subsequently processed. Any documents that have been previously added to an index and that are no-longer available in the data source are removed from the index.

As part of processing a document, the system extracts and embeds chunks, as configured for the index. Once a document has been processed and its metadata and chunks have been stored, the original, downloaded document is removed from memory and storage (the original files remain on the data source are never modified or deleted).

Depending on the number of documents, an indexing can take a significant amount of time. An indexing is considered complete once all documents from a data source been crawled, once all discovered documents have been processed fully, and once any document removed from the data source has been removed from the index.

Note that you can only trigger an indexing for an index of a knowledge base index that was created with data_origin_type=DATA_SOURCES. For any other type of index, an indexing is triggered automatically when documents are uploaded to the index via the API. For details, refer to the method to Add a document to an index.

Note that you can only run one indexing per index at any point in time. If an indexing is currently running when you create a new one, the newly created indexing will be queued until the running indexing completes. If an indexing is already queued, creating another indexing will result in an error (as there is no need to queue a second indexing).

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

knowledge_base_id

string
index_id
Required

index_id


Authentication
This operation uses the following authentication methods.
Responses
201

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.


400

Creation of indexing for knowledge base with local files not allowed.

Operation doesn't return any data structure

404

Invalid knowledge base or index ID.

Operation doesn't return any data structure

409

An active Indexing already exists for this knowledge base 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