Provides API endpoints related to documents
Summary
Functions
Bulk index documents
Delete document
Index document
Index documents
Schedules the processing of uploaded documents
Update document permissions
Functions
@spec bulkindexdocuments( body :: Gleanex.Indexing.BulkIndexDocumentsRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Bulk index documents
Replaces the documents in a datasource using paginated batch API calls. Please refer to the bulk indexing documentation for an explanation of how to use bulk endpoints.
Request Body
Content Types: application/json
@spec deletedocument( body :: Gleanex.Indexing.DeleteDocumentRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Delete document
Deletes the specified document from the index. Succeeds if document is not present.
Request Body
Content Types: application/json
@spec indexdocument( body :: Gleanex.Indexing.IndexDocumentRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Index document
Adds a document to the index or updates an existing document.
Request Body
Content Types: application/json
@spec indexdocuments( body :: Gleanex.Indexing.IndexDocumentsRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Index documents
Adds or updates multiple documents in the index. Please refer to the bulk indexing documentation for an explanation of when to use this endpoint.
Request Body
Content Types: application/json
@spec processalldocuments( body :: Gleanex.Indexing.ProcessAllDocumentsRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Schedules the processing of uploaded documents
Schedules the immediate processing of documents uploaded through the indexing API. By default the uploaded documents will be processed asynchronously but this API can be used to schedule processing of all documents on demand.
If a datasource parameter is specified, processing is limited to that custom datasource. Without it, processing applies to all documents across all custom datasources.
Rate Limits
This endpoint is rate-limited to one usage every 3 hours. Exceeding this limit results in a 429 response code. Here's how the rate limit works:
- Calling
/processalldocumentsfor datasourcefooprevents another call forfoofor 3 hours. - Calling
/processalldocumentsfor datasourcefoodoesn't affect immediate calls forbar. - Calling
/processalldocumentsfor all datasources prevents any datasource calls for 3 hours. - Calling
/processalldocumentsfor datasourcefoodoesn't affect immediate calls for all datasources.
For more frequent document processing, contact Glean support.
Request Body
Content Types: application/json
@spec updatepermissions( body :: Gleanex.Indexing.UpdatePermissionsRequest.t(), opts :: keyword() ) :: :ok | {:error, Gleanex.Error.t()}
Update document permissions
Updates the permissions for a given document without modifying document content.
Request Body
Content Types: application/json