mars-server · discovery
Public declarations and documentation for mars-server::discovery.
Package: mars-server · Workspace version: 0.1.0 · Module: discovery
This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.
discovery::DiscoveryEngine
Discovery engine that executes MARS-QL queries against a store.
pub struct DiscoveryEngine {
}Source line: 45.
discovery::DiscoveryEngine::new
Create a new discovery engine backed by the given store.
pub fn new(
store: Arc<dyn EntryStore>,
default_page_size: u64,
max_page_size: u64,
cursor_codec: SearchCursorCodec,
) -> Self;Source line: 56.
discovery::DiscoveryEngine::with_anchor_policy
Create a discovery engine with the registry's anchoring visibility policy.
pub fn with_anchor_policy(
store: Arc<dyn EntryStore>,
default_page_size: u64,
max_page_size: u64,
anchoring_required: bool,
cursor_codec: SearchCursorCodec,
) -> Self;Source line: 74.
discovery::DiscoveryEngine::with_semantic_search_port
Register a MARS-owned semantic adapter without coupling MARS to a concrete cognitive engine.
#[must_use]
pub fn with_semantic_search_port(mut self, port: Arc<dyn SemanticSearchPort>) -> Self;Source line: 94.
discovery::DiscoveryEngine::execute
Execute a MARS-QL query and return matching entries.
pub async fn execute(&self, query: &MarsQuery) -> Result<MarsQueryResult, ServerError>;Source line: 100.
discovery::DiscoveryEngine::execute_semantic
Execute semantic discovery when an adapter has been explicitly registered. The default is a fail-closed disabled result.
pub async fn execute_semantic(
&self,
request: &SemanticSearchRequest,
) -> Result<Vec<SemanticSearchHit>, SemanticSearchError>;Source line: 114.
discovery::execute_query
Execute a MARS-QL query against a store (stateless entry point).
This function performs the full query pipeline: filtering, sorting (or
ranking if no explicit ordering), and pagination. It is the canonical
implementation used by both the struct-based [DiscoveryEngine] and the
REST/WebSocket API handlers.
pub async fn execute_query(
store: &dyn EntryStore,
query: &MarsQuery,
default_limit: u64,
max_limit: u64,
cursor_codec: &SearchCursorCodec,
) -> Result<MarsQueryResult, ServerError>;Source line: 135.
discovery::compute_ranking_score
Compute the 5-component composite ranking score for an entry.
Each component is normalized to [0, 1] and multiplied by its weight.
The result is in [0, 1].
pub fn compute_ranking_score(entry: &MarsEntry, query: &MarsQuery) -> f64;Source line: 187.
discovery::execute_sharded_query
Execute a sharded MARS-QL query using scatter-gather.
When the sharding feature is enabled, this function:
- Extracts shard hints from the [
ShardedQuery] to determine target shards. - Scatter-queries only the relevant shards (or all if no hints).
- Gathers results, applies sorting/ranking, and paginates.
#[cfg(feature = "sharding")]
pub async fn execute_sharded_query(
sharded_store: &dyn crate::store::ShardedStore,
sharded_query: &mars_protocol::marsql::ShardedQuery,
default_limit: u64,
max_limit: u64,
cursor_codec: &SearchCursorCodec,
) -> Result<MarsQueryResult, ServerError>;Source line: 275.
Source provenance
Source: mars-server/src/discovery/mod.rs · SHA-256 417462ed94da91b0ef8180bbfd24c01c63a6aa490b53fc6c6df472c6f35cb8c9. Package overview.