OpenApiTypesense.Operations
(OpenApiTypesense v1.3.1)
View Source
Provides API endpoints related to operations
Summary
Functions
Clear the cached responses of search requests in the LRU cache.
Compacting the on-disk database
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.
Toggle Slow Request Log
Triggers a follower node to initiate the raft voting process, which triggers leader re-election.
Functions
@spec clear_cache(opts :: keyword()) :: {:ok, OpenApiTypesense.SuccessStatus.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Clear the cached responses of search requests in the LRU cache.
Clear the cached responses of search requests that are sent with use_cache parameter in the LRU cache.
@spec compact_db(opts :: keyword()) :: {:ok, OpenApiTypesense.SuccessStatus.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Compacting the on-disk 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.
@spec get_schema_changes(opts :: 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.
@spec retrieve_api_stats(opts :: keyword()) :: {:ok, OpenApiTypesense.APIStatsResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Get stats about API endpoints.
Retrieve the stats about API endpoints.
@spec retrieve_metrics(opts :: keyword()) :: {:ok, map()} | {:error, OpenApiTypesense.ApiResponse.t()}
Get current RAM, CPU, Disk & Network usage metrics.
Retrieve the metrics.
@spec take_snapshot(opts :: 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.
@spec toggle_slow_request_log(body :: map(), opts :: keyword()) :: {:ok, OpenApiTypesense.SuccessStatus.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Toggle Slow Request Log
Enable logging of requests that take over a defined threshold of time. Default is -1 which disables slow request logging. Slow requests are logged to the primary log file, with the prefix SLOW REQUEST.
Required body
log-slow-requests-time-ms: Defaults to-1
Example
iex> body = %{"log-slow-requests-time-ms" => 2_000}
iex> OpenApiTypesense.Operations.toggle_slow_request_log(body)`
@spec vote(opts :: keyword()) :: {:ok, OpenApiTypesense.SuccessStatus.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
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.