TantivyEx.Distributed.SearchNode (TantivyEx v0.4.1)

View Source

GenServer representing a single search node in the distributed cluster.

Each SearchNode manages its own Tantivy searcher instance and handles search requests, health monitoring, and connection management.

Summary

Functions

Returns a specification to start this module under a supervisor.

Get the current health status.

Get node statistics.

Perform a health check on the node.

Check if the node is currently active.

Perform a search on this node.

Set the node's active status.

Start a search node GenServer.

Types

health_status()

@type health_status() :: :healthy | :degraded | :unhealthy | :unknown

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_health_status(pid)

@spec get_health_status(pid()) :: health_status()

Get the current health status.

get_stats(pid)

@spec get_stats(pid()) :: {:ok, map()}

Get node statistics.

health_check(pid)

@spec health_check(pid()) :: :ok

Perform a health check on the node.

is_active?(pid)

@spec is_active?(pid()) :: boolean()

Check if the node is currently active.

search(pid, query, limit, offset)

@spec search(pid(), term(), non_neg_integer(), non_neg_integer()) ::
  {:ok, map()} | {:error, term()}

Perform a search on this node.

set_active(pid, active)

@spec set_active(pid(), boolean()) :: :ok

Set the node's active status.

start_link(opts)

Start a search node GenServer.