mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 19:45:05 +08:00
feat: Change the query name to 'q'
This commit is contained in:
parent
c99ba88288
commit
d2fb2ff404
@ -30,7 +30,7 @@ struct Opt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
struct SearchQuery { query: String }
|
struct SearchQuery { q: String }
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
struct Document<'a> {
|
struct Document<'a> {
|
||||||
@ -120,7 +120,7 @@ fn main() {
|
|||||||
let routes = warp::path("search")
|
let routes = warp::path("search")
|
||||||
.and(warp::query())
|
.and(warp::query())
|
||||||
.map(move |query: SearchQuery| {
|
.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
|
body
|
||||||
})
|
})
|
||||||
.with(warp::reply::with::header("Content-Type", "application/json"))
|
.with(warp::reply::with::header("Content-Type", "application/json"))
|
||||||
|
Loading…
Reference in New Issue
Block a user