diff --git a/meilisearch-http/src/main.rs b/meilisearch-http/src/main.rs index 1782f9126..0ede01bbb 100644 --- a/meilisearch-http/src/main.rs +++ b/meilisearch-http/src/main.rs @@ -70,7 +70,7 @@ async fn main() -> Result<(), MainError> { Cors::new() .send_wildcard() .allowed_header("x-meili-api-key") - .max_age(86_400) // 24h + //.max_age(86_400) // 24h .finish(), ) .wrap(middleware::Logger::default()) diff --git a/meilisearch-http/src/routes/search.rs b/meilisearch-http/src/routes/search.rs index 4a10ae649..fd1188c39 100644 --- a/meilisearch-http/src/routes/search.rs +++ b/meilisearch-http/src/routes/search.rs @@ -17,7 +17,8 @@ use meilisearch_core::facets::FacetFilter; use meilisearch_schema::{Schema, FieldId}; pub fn services(cfg: &mut web::ServiceConfig) { - cfg.service(search_with_url_query); + cfg.service(search_with_post) + .service(search_with_url_query); } #[derive(Deserialize)] @@ -26,10 +27,7 @@ struct SearchQuery { q: String, offset: Option, limit: Option, - attributes_to_retrieve: Option, - attributes_to_crop: Option, - crop_length: Option, - attributes_to_highlight: Option, + attributes_to_retrieve: Option, attributes_to_crop: Option, crop_length: Option, attributes_to_highlight: Option, filters: Option, matches: Option, facet_filters: Option, @@ -50,7 +48,7 @@ async fn search_with_url_query( async fn search_with_post( data: web::Data, path: web::Path, - params: web::Query, + params: web::Json, ) -> Result { let search_result = params.search(&path.index_uid, data)?; Ok(HttpResponse::Ok().json(search_result))