Add server subcommand
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user