Gleanex.Indexing.Documents (Gleanex v0.1.0)

Copy Markdown View Source

Provides API endpoints related to documents

Summary

Functions

Schedules the processing of uploaded documents

Update document permissions

Functions

bulkindexdocuments(body, opts \\ [])

@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

deletedocument(body, opts \\ [])

@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

indexdocument(body, opts \\ [])

@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

indexdocuments(body, opts \\ [])

@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

processalldocuments(body, opts \\ [])

@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:

  1. Calling /processalldocuments for datasource foo prevents another call for foo for 3 hours.
  2. Calling /processalldocuments for datasource foo doesn't affect immediate calls for bar.
  3. Calling /processalldocuments for all datasources prevents any datasource calls for 3 hours.
  4. Calling /processalldocuments for datasource foo doesn't affect immediate calls for all datasources.

For more frequent document processing, contact Glean support.

Request Body

Content Types: application/json

updatepermissions(body, opts \\ [])

@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