Add server subcommand

This commit is contained in:
2026-03-23 21:43:18 -07:00
parent 76d38d48c5
commit dfcb4b0a24
7 changed files with 184 additions and 10 deletions

View File

@@ -48,13 +48,10 @@ pub async fn lookup(
Json(body): Json<LookupRequest>,
) -> Response {
let start = Instant::now();
debug!(
message = "Serving /lookup",
query = body.query,
limit = body.limit.unwrap_or(10)
);
let limit = body.limit.unwrap_or(128).min(1024);
debug!(message = "Serving /lookup", query = body.query, limit);
let results: Vec<LookupResult> = match state.fts_lookup(&body.query, body.limit.unwrap_or(10)) {
let results: Vec<LookupResult> = match state.fts_lookup(&body.query, limit) {
Ok(x) => x
.into_iter()
.map(|x| LookupResult {