mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
remove timeout search query parameter
fix requested changes
This commit is contained in:
parent
bc8ff49de3
commit
ea308eb798
@ -17,6 +17,7 @@ pub enum Authentication {
|
|||||||
Admin,
|
Admin,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl<S: 'static, B> Transform<S> for Authentication
|
impl<S: 'static, B> Transform<S> for Authentication
|
||||||
where
|
where
|
||||||
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::Instant;
|
||||||
|
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use log::error;
|
use log::error;
|
||||||
@ -33,7 +33,6 @@ impl IndexSearchExt for Index {
|
|||||||
attributes_to_retrieve: None,
|
attributes_to_retrieve: None,
|
||||||
attributes_to_highlight: None,
|
attributes_to_highlight: None,
|
||||||
filters: None,
|
filters: None,
|
||||||
timeout: Duration::from_millis(30),
|
|
||||||
matches: false,
|
matches: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -48,7 +47,6 @@ pub struct SearchBuilder<'a> {
|
|||||||
attributes_to_retrieve: Option<HashSet<String>>,
|
attributes_to_retrieve: Option<HashSet<String>>,
|
||||||
attributes_to_highlight: Option<HashSet<String>>,
|
attributes_to_highlight: Option<HashSet<String>>,
|
||||||
filters: Option<String>,
|
filters: Option<String>,
|
||||||
timeout: Duration,
|
|
||||||
matches: bool,
|
matches: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +87,6 @@ impl<'a> SearchBuilder<'a> {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn timeout(&mut self, value: Duration) -> &SearchBuilder {
|
|
||||||
self.timeout = value;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_matches(&mut self) -> &SearchBuilder {
|
pub fn get_matches(&mut self) -> &SearchBuilder {
|
||||||
self.matches = true;
|
self.matches = true;
|
||||||
self
|
self
|
||||||
@ -130,8 +123,6 @@ impl<'a> SearchBuilder<'a> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
query_builder.with_fetch_timeout(self.timeout);
|
|
||||||
|
|
||||||
if let Some(field) = self.index.main.distinct_attribute(reader)? {
|
if let Some(field) = self.index.main.distinct_attribute(reader)? {
|
||||||
if let Some(field_id) = schema.id(&field) {
|
if let Some(field_id) = schema.id(&field) {
|
||||||
query_builder.with_distinct(1, move |id| {
|
query_builder.with_distinct(1, move |id| {
|
||||||
@ -192,7 +183,7 @@ impl<'a> SearchBuilder<'a> {
|
|||||||
.document(reader, attributes.as_ref(), doc.id)
|
.document(reader, attributes.as_ref(), doc.id)
|
||||||
.map_err(|e| ResponseError::retrieve_document(doc.id.0, e))?
|
.map_err(|e| ResponseError::retrieve_document(doc.id.0, e))?
|
||||||
.ok_or(ResponseError::internal(
|
.ok_or(ResponseError::internal(
|
||||||
"Impossible to retrieve a document id returned by the engine",
|
"Impossible to retrieve the document; Corrupted data",
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
let mut formatted = document.iter()
|
let mut formatted = document.iter()
|
||||||
|
@ -15,11 +15,11 @@ mod analytics;
|
|||||||
#[global_allocator]
|
#[global_allocator]
|
||||||
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
||||||
|
|
||||||
#[tokio::main]
|
#[actix_rt::main]
|
||||||
async fn main() -> Result<(), MainError> {
|
async fn main() -> Result<(), MainError> {
|
||||||
let opt = Opt::from_args();
|
let opt = Opt::from_args();
|
||||||
let local = tokio::task::LocalSet::new();
|
// let local = tokio::task::LocalSet::new();
|
||||||
let _sys = actix_rt::System::run_in_tokio("server", &local);
|
// let _sys = actix_rt::System::run_in_tokio("server", &local);
|
||||||
|
|
||||||
match opt.env.as_ref() {
|
match opt.env.as_ref() {
|
||||||
"production" => {
|
"production" => {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use std::collections::{HashSet, HashMap};
|
use std::collections::{HashSet, HashMap};
|
||||||
use std::time::Duration;
|
|
||||||
|
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use actix_web::web;
|
use actix_web::web;
|
||||||
@ -27,7 +26,6 @@ struct SearchQuery {
|
|||||||
crop_length: Option<usize>,
|
crop_length: Option<usize>,
|
||||||
attributes_to_highlight: Option<String>,
|
attributes_to_highlight: Option<String>,
|
||||||
filters: Option<String>,
|
filters: Option<String>,
|
||||||
timeout_ms: Option<u64>,
|
|
||||||
matches: Option<bool>,
|
matches: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,10 +131,6 @@ async fn search_with_url_query(
|
|||||||
search_builder.filters(filters.to_string());
|
search_builder.filters(filters.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(timeout_ms) = params.timeout_ms {
|
|
||||||
search_builder.timeout(Duration::from_millis(timeout_ms));
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(matches) = params.matches {
|
if let Some(matches) = params.matches {
|
||||||
if matches {
|
if matches {
|
||||||
search_builder.get_matches();
|
search_builder.get_matches();
|
||||||
|
Loading…
Reference in New Issue
Block a user