forgotten changes to the lib that are needed for a single port of two crates working separately

This commit is contained in:
filipriec
2025-06-08 22:40:46 +02:00
parent 645172747a
commit a3e7fd8f0a

View File

@@ -2,15 +2,13 @@
use std::path::Path;
use tantivy::{collector::TopDocs, query::QueryParser, Index, TantivyDocument};
use tonic::{transport::Server, Request, Response, Status};
use tonic_reflection::server::Builder as ReflectionBuilder;
use common::proto::multieko2::FILE_DESCRIPTOR_SET;
use tonic::{Request, Response, Status};
use common::proto::multieko2::search::{
search_response::Hit,
searcher_server::{Searcher, SearcherServer},
SearchRequest, SearchResponse,
search_response::Hit, SearchRequest, SearchResponse,
};
use common::proto::multieko2::search::searcher_server::Searcher;
pub use common::proto::multieko2::search::searcher_server::SearcherServer;
use tantivy::schema::Value;
pub struct SearcherService;
@@ -109,24 +107,3 @@ impl Searcher for SearcherService {
Ok(Response::new(response))
}
}
pub async fn run_search_service(
addr: &str,
) -> Result<(), Box<dyn std::error::Error>> {
let addr = addr.parse()?;
let searcher_service = SearcherService;
let reflection_service = ReflectionBuilder::configure()
.register_encoded_file_descriptor_set(FILE_DESCRIPTOR_SET)
.build_v1()?;
println!("Search service listening on {}", addr);
Server::builder()
.add_service(SearcherServer::new(searcher_service))
.add_service(reflection_service)
.serve(addr)
.await?;
Ok(())
}