about summary refs log tree commit diff
path: root/src/search/native.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/search/native.rs')
-rw-r--r--src/search/native.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/search/native.rs b/src/search/native.rs
deleted file mode 100644
index 667e786..0000000
--- a/src/search/native.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-//! The native [`Engine`]: a thin wrapper over the extracted engine.
-//!
-//! The engine itself — the `QueryParser` configuration and every
-//! prefix/slot registration, the checked parse, the Hs/Mm and numeric-range
-//! guards, `open_database` and its pre-checks, the full-match-set fetch and
-//! the doc-data decode — now lives in the `gn-search` crate
-//! (`gn-search/src/native.rs`; before the move this file was the whole
-//! 1003-line engine, and that code is unchanged there).
-//!
-//! What is left here is the [`Engine`] impl and nothing else: it delegates
-//! to [`CrateEngine`], so `SEARCH_ENGINE=native` and `SEARCH_ENGINE=crate`
-//! are the same engine, reached through the same seam, with the same error
-//! classes — including the unset-index `Internal` that names
-//! `XAPIAN_DB_PATH`. They cannot diverge, and no behaviour above this
-//! module learns that the engine moved.
-//!
-//! The async shell stays here rather than in the crate because xapian calls
-//! are synchronous C++ work: [`CrateEngine`] keeps them off the runtime's
-//! workers with `spawn_blocking` (the house pattern, cf. every
-//! `spawn_blocking` handler in `src/routes`), and that is the only thing
-//! this module adds.
-
-use super::gnindex::CrateEngine;
-use super::{Engine, SearchError, SearchHit};
-
-/// The native xapian search engine. Configure the index directory with
-/// `XAPIAN_DB_PATH` and select it with `SEARCH_ENGINE=native`; the
-/// default remains the gn3 forwarder (see [`crate::search::search`]).
-pub struct Native;
-
-impl Engine for Native {
-    async fn search(
-        &self,
-        q: &str,
-        type_: &str,
-        limit: u64,
-        page: u64,
-    ) -> Result<Vec<SearchHit>, SearchError> {
-        CrateEngine::from_config()
-            .search(q, type_, limit, page)
-            .await
-    }
-}