OpenApiTypesense.Operations (OpenApiTypesense v1.0.1)

View Source

Provides API endpoints related to operations

Summary

Functions

Clears the cache

Compaction of the underlying RocksDB database

Enable logging of requests that take over a defined threshold of time.

Get the status of in-progress schema change operations

Get stats about API endpoints.

Get current RAM, CPU, Disk & Network usage metrics.

Creates a point-in-time snapshot of a Typesense node's state and data in the specified directory.

Triggers a follower node to initiate the raft voting process, which triggers leader re-election.

Functions

clear_cache(opts \\ [])

(since 0.4.2)
@spec clear_cache(keyword()) ::
  {:ok, OpenApiTypesense.SuccessStatus.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Clears the cache

Responses of search requests that are sent with use_cache parameter are cached in a LRU cache. Clears cache completely.

compact(opts \\ [])

(since 0.4.2)
@spec compact(keyword()) ::
  {:ok, OpenApiTypesense.SuccessStatus.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Compaction of the underlying RocksDB database

Typesense uses RocksDB to store your documents on the disk. If you do frequent writes or updates, you could benefit from running a compaction of the underlying RocksDB database. This could reduce the size of the database and decrease read latency. While the database will not block during this operation, we recommend running it during off-peak hours.

config(body, opts \\ [])

(since 0.4.2)

Enable logging of requests that take over a defined threshold of time.

Slow requests are logged to the primary log file, with the prefix SLOW REQUEST. Default is -1 which disables slow request logging.

get_schema_changes(opts \\ [])

(since 0.7.0)
@spec get_schema_changes(keyword()) ::
  {:ok, [OpenApiTypesense.SchemaChangeStatus.t()]}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Get the status of in-progress schema change operations

Returns the status of any ongoing schema change operations. If no schema changes are in progress, returns an empty response.

retrieve_api_stats(opts \\ [])

(since 0.4.0)
@spec retrieve_api_stats(keyword()) ::
  {:ok, OpenApiTypesense.APIStatsResponse.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Get stats about API endpoints.

Retrieve the stats about API endpoints.

retrieve_metrics(opts \\ [])

(since 0.4.0)
@spec retrieve_metrics(keyword()) ::
  {:ok, map()} | {:error, OpenApiTypesense.ApiResponse.t()}

Get current RAM, CPU, Disk & Network usage metrics.

Retrieve the metrics.

take_snapshot(opts \\ [])

(since 0.4.0)
@spec take_snapshot(keyword()) ::
  {:ok, OpenApiTypesense.SuccessStatus.t()}
  | {:error, OpenApiTypesense.ApiResponse.t()}

Creates a point-in-time snapshot of a Typesense node's state and data in the specified directory.

Creates a point-in-time snapshot of a Typesense node's state and data in the specified directory. You can then backup the snapshot directory that gets created and later restore it as a data directory, as needed.

Options

  • snapshot_path: The directory on the server where the snapshot should be saved.

vote(opts \\ [])

(since 0.4.0)

Triggers a follower node to initiate the raft voting process, which triggers leader re-election.

Triggers a follower node to initiate the raft voting process, which triggers leader re-election. The follower node that you run this operation against will become the new leader, once this command succeeds.