mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
1651: Use reset_sortable_fields r=Kerollmops a=shekhirin Resolves https://github.com/meilisearch/MeiliSearch/issues/1635 1676: Add curl binary to final stage image r=curquiza a=ook Reference: #1673 Changes: * add `curl` binary to final docker Melisearch image. For metrics, docker funny layer management makes this add a shrink from 319MB to 315MB: ``` ☁ MeiliSearch [feature/1673-add-curl-to-docker-image] ⚡ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE getmeili/meilisearch 0.22.0_ook_1673 938e239ad989 2 hours ago 315MB getmeili/meilisearch latest 258fa3aa1230 6 days ago 319MB ``` 1684: bump dependencies r=MarinPostma a=MarinPostma Bump meilisearch dependencies. We still depend on custom patch that have been upgraded along the way. Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com> Co-authored-by: Thomas Lecavelier <thomas@followanalytics.com> Co-authored-by: mpostma <postma.marin@protonmail.com>
This commit is contained in:
commit
6fafdb7711
13 changed files with 410 additions and 437 deletions
|
@ -3,8 +3,8 @@ use std::fmt;
|
|||
|
||||
use actix_web as aweb;
|
||||
use actix_web::body::Body;
|
||||
use actix_web::dev::BaseHttpResponseBuilder;
|
||||
use actix_web::http::StatusCode;
|
||||
use actix_web::HttpResponseBuilder;
|
||||
use aweb::error::{JsonPayloadError, QueryPayloadError};
|
||||
use meilisearch_error::{Code, ErrorCode};
|
||||
use milli::UserError;
|
||||
|
@ -43,9 +43,9 @@ where
|
|||
}
|
||||
|
||||
impl aweb::error::ResponseError for ResponseError {
|
||||
fn error_response(&self) -> aweb::BaseHttpResponse<Body> {
|
||||
fn error_response(&self) -> aweb::HttpResponse<Body> {
|
||||
let json = serde_json::to_vec(self).unwrap();
|
||||
BaseHttpResponseBuilder::new(self.status_code())
|
||||
HttpResponseBuilder::new(self.status_code())
|
||||
.content_type("application/json")
|
||||
.body(json)
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ impl ErrorCode for PayloadError {
|
|||
fn error_code(&self) -> Code {
|
||||
match self {
|
||||
PayloadError::Json(err) => match err {
|
||||
JsonPayloadError::Overflow => Code::PayloadTooLarge,
|
||||
JsonPayloadError::Overflow { .. } => Code::PayloadTooLarge,
|
||||
JsonPayloadError::ContentType => Code::UnsupportedMediaType,
|
||||
JsonPayloadError::Payload(aweb::error::PayloadError::Overflow) => {
|
||||
Code::PayloadTooLarge
|
||||
|
|
|
@ -145,7 +145,7 @@ impl<P: Policy + 'static, D: 'static + Clone> FromRequest for GuardedData<P, D>
|
|||
|
||||
fn from_request(
|
||||
req: &actix_web::HttpRequest,
|
||||
_payload: &mut actix_http::Payload,
|
||||
_payload: &mut actix_web::dev::Payload,
|
||||
) -> Self::Future {
|
||||
match req.app_data::<Self::Config>() {
|
||||
Some(config) => match config {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use actix_http::error::PayloadError;
|
||||
use actix_web::error::PayloadError;
|
||||
use actix_web::{dev, web, FromRequest, HttpRequest};
|
||||
use futures::future::{ready, Ready};
|
||||
use futures::Stream;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::collections::{BTreeMap, BTreeSet, HashSet};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::io;
|
||||
use std::marker::PhantomData;
|
||||
use std::num::NonZeroUsize;
|
||||
|
@ -265,10 +265,7 @@ impl Index {
|
|||
Setting::Set(ref fields) => {
|
||||
builder.set_sortable_fields(fields.iter().cloned().collect())
|
||||
}
|
||||
Setting::Reset => {
|
||||
// TODO we must use the reset_sortable_fields in a futur PR.
|
||||
builder.set_sortable_fields(HashSet::new())
|
||||
}
|
||||
Setting::Reset => builder.reset_sortable_fields(),
|
||||
Setting::NotSet => (),
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ mod test {
|
|||
#[actix_rt::test]
|
||||
async fn test_normal() {
|
||||
let mut rng = rand::thread_rng();
|
||||
let uuids_num: usize = rng.gen_range(5, 10);
|
||||
let uuids_num: usize = rng.gen_range(5..10);
|
||||
let uuids = (0..uuids_num)
|
||||
.map(|_| Uuid::new_v4())
|
||||
.collect::<HashSet<_>>();
|
||||
|
|
|
@ -53,7 +53,7 @@ impl ErrorCode for UpdateActorError {
|
|||
UpdateActorError::FatalUpdateStoreError => Code::Internal,
|
||||
UpdateActorError::InvalidPayload(_) => Code::BadRequest,
|
||||
UpdateActorError::PayloadError(error) => match error {
|
||||
actix_http::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
actix_web::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
_ => Code::Internal,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::{collections::HashSet, path::PathBuf};
|
||||
|
||||
use actix_http::error::PayloadError;
|
||||
use actix_web::error::PayloadError;
|
||||
use tokio::sync::mpsc;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
|
|
@ -43,18 +43,15 @@ pub mod data;
|
|||
pub mod error;
|
||||
#[macro_use]
|
||||
pub mod extractors;
|
||||
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||
pub mod analytics;
|
||||
pub mod helpers;
|
||||
mod index;
|
||||
mod index_controller;
|
||||
pub mod option;
|
||||
pub mod routes;
|
||||
|
||||
#[cfg(all(not(debug_assertions), feature = "analytics"))]
|
||||
pub mod analytics;
|
||||
|
||||
use crate::extractors::authentication::AuthConfig;
|
||||
|
||||
pub use self::data::Data;
|
||||
use crate::extractors::authentication::AuthConfig;
|
||||
pub use option::Opt;
|
||||
|
||||
use actix_web::web;
|
||||
|
@ -65,7 +62,7 @@ use extractors::payload::PayloadConfig;
|
|||
pub fn configure_data(config: &mut web::ServiceConfig, data: Data) {
|
||||
let http_payload_size_limit = data.http_payload_size_limit();
|
||||
config
|
||||
.data(data.clone())
|
||||
.app_data(web::Data::new(data.clone()))
|
||||
.app_data(data)
|
||||
.app_data(
|
||||
web::JsonConfig::default()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue