OpenApiTypesense.Operations (OpenApiTypesense v1.0.1)
View SourceProvides 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
@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.
@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.
@spec config( OpenApiTypesense.ConfigSchema.t(), keyword() ) :: {:ok, OpenApiTypesense.SuccessStatus.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
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.
@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.
@spec retrieve_api_stats(keyword()) :: {:ok, OpenApiTypesense.APIStatsResponse.t()} | {:error, OpenApiTypesense.ApiResponse.t()}
Get stats about API endpoints.
Retrieve the stats about API endpoints.
@spec retrieve_metrics(keyword()) :: {:ok, map()} | {:error, OpenApiTypesense.ApiResponse.t()}
Get current RAM, CPU, Disk & Network usage metrics.
Retrieve the metrics.
@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.
@spec vote(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.