feat: add debug index function to api

This commit is contained in:
2024-02-12 23:15:44 +01:00
parent 655b2df151
commit ecdad1b553
3 changed files with 12 additions and 1 deletions

View File

@@ -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!")
}