From 50c51dd6b73802e41bba2d6eee579d506386d2d7 Mon Sep 17 00:00:00 2001 From: beann <1012252+beann@user.noreply.gitee.com> Date: Mon, 30 Mar 2026 18:26:11 +0800 Subject: [PATCH] refactor: remove redundant max_results from SearxngSearchConfig --- crates/openfang-runtime/src/web_search.rs | 2 +- crates/openfang-types/src/config.rs | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/crates/openfang-runtime/src/web_search.rs b/crates/openfang-runtime/src/web_search.rs index 544cf8f1..cf4613fb 100644 --- a/crates/openfang-runtime/src/web_search.rs +++ b/crates/openfang-runtime/src/web_search.rs @@ -330,7 +330,7 @@ impl WebSearchEngine { return Err("SearXNG URL is not configured".to_string()); } - let limit = max_results.min(self.config.searxng.max_results); + let limit = max_results; debug!(query, "Searching via SearXNG"); diff --git a/crates/openfang-types/src/config.rs b/crates/openfang-types/src/config.rs index 2cdd7e59..db8536aa 100644 --- a/crates/openfang-types/src/config.rs +++ b/crates/openfang-types/src/config.rs @@ -287,22 +287,11 @@ impl Default for PerplexitySearchConfig { } /// SearXNG self-hosted search configuration. -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, Default, Serialize, Deserialize)] #[serde(default)] pub struct SearxngSearchConfig { /// Base URL of the SearXNG instance (e.g., "https://search.example.com"). pub url: String, - /// Maximum results to return. - pub max_results: usize, -} - -impl Default for SearxngSearchConfig { - fn default() -> Self { - Self { - url: String::new(), - max_results: 5, - } - } } /// Web fetch configuration.