feat: Change the query name to 'q'

This commit is contained in:
Clément Renault 2018-09-21 22:37:43 +02:00
parent c99ba88288
commit d2fb2ff404
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ struct Opt {
}
#[derive(Debug, Deserialize)]
struct SearchQuery { query: String }
struct SearchQuery { q: String }
#[derive(Debug, Serialize)]
struct Document<'a> {
@ -120,7 +120,7 @@ fn main() {
let routes = warp::path("search")
.and(warp::query())
.map(move |query: SearchQuery| {
let body = search(meta.clone(), db.clone(), &common_words, &query.query).unwrap();
let body = search(meta.clone(), db.clone(), &common_words, &query.q).unwrap();
body
})
.with(warp::reply::with::header("Content-Type", "application/json"))