feat: add debug index function to api
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use actix_web::{web, HttpRequest, HttpResponse, Responder};
|
||||
use actix_web::{web, HttpResponse, Responder};
|
||||
use serde::Deserialize;
|
||||
|
||||
use crate::types::app_state::AppStateWithSearchEngine;
|
||||
@@ -35,4 +35,9 @@ pub async fn search(data: web::Data<AppStateWithSearchEngine>, req: web::Query<Q
|
||||
|
||||
let results = data.search_engine.lock().unwrap().search(&req.query);
|
||||
HttpResponse::Ok().json(results)
|
||||
}
|
||||
|
||||
pub async fn debug_index(data: web::Data<AppStateWithSearchEngine>) -> impl Responder {
|
||||
data.search_engine.lock().unwrap().debug_index();
|
||||
HttpResponse::Ok().json("Index debugged!")
|
||||
}
|
Reference in New Issue
Block a user