mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-07 12:45:40 +00:00
Cargo fmt
This commit is contained in:
parent
8fdcdee0cc
commit
82313a4444
@ -2,7 +2,8 @@ mod datasets_paths;
|
|||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use criterion::{criterion_group, criterion_main};
|
use criterion::{criterion_group, criterion_main};
|
||||||
use milli::{update::Settings, FilterableAttributesRule};
|
use milli::update::Settings;
|
||||||
|
use milli::FilterableAttributesRule;
|
||||||
use utils::Conf;
|
use utils::Conf;
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
@ -2,7 +2,8 @@ mod datasets_paths;
|
|||||||
mod utils;
|
mod utils;
|
||||||
|
|
||||||
use criterion::{criterion_group, criterion_main};
|
use criterion::{criterion_group, criterion_main};
|
||||||
use milli::{update::Settings, FilterableAttributesRule};
|
use milli::update::Settings;
|
||||||
|
use milli::FilterableAttributesRule;
|
||||||
use utils::Conf;
|
use utils::Conf;
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
@ -375,9 +375,11 @@ impl IndexScheduler {
|
|||||||
post_commit_dabases_sizes
|
post_commit_dabases_sizes
|
||||||
.get(dbname)
|
.get(dbname)
|
||||||
.map(|post_size| {
|
.map(|post_size| {
|
||||||
use byte_unit::{Byte, UnitType::Binary};
|
|
||||||
use std::cmp::Ordering::{Equal, Greater, Less};
|
use std::cmp::Ordering::{Equal, Greater, Less};
|
||||||
|
|
||||||
|
use byte_unit::Byte;
|
||||||
|
use byte_unit::UnitType::Binary;
|
||||||
|
|
||||||
let post = Byte::from_u64(*post_size as u64).get_appropriate_unit(Binary);
|
let post = Byte::from_u64(*post_size as u64).get_appropriate_unit(Binary);
|
||||||
let diff_size = post_size.abs_diff(*pre_size) as u64;
|
let diff_size = post_size.abs_diff(*pre_size) as u64;
|
||||||
let diff = Byte::from_u64(diff_size).get_appropriate_unit(Binary);
|
let diff = Byte::from_u64(diff_size).get_appropriate_unit(Binary);
|
||||||
|
@ -2,10 +2,9 @@ use std::time::Instant;
|
|||||||
|
|
||||||
use big_s::S;
|
use big_s::S;
|
||||||
use meili_snap::snapshot;
|
use meili_snap::snapshot;
|
||||||
use meilisearch_types::milli::obkv_to_json;
|
|
||||||
use meilisearch_types::milli::update::IndexDocumentsMethod::*;
|
use meilisearch_types::milli::update::IndexDocumentsMethod::*;
|
||||||
use meilisearch_types::milli::update::Setting;
|
use meilisearch_types::milli::update::Setting;
|
||||||
use meilisearch_types::milli::FilterableAttributesRule;
|
use meilisearch_types::milli::{obkv_to_json, FilterableAttributesRule};
|
||||||
use meilisearch_types::tasks::{Kind, KindWithContent};
|
use meilisearch_types::tasks::{Kind, KindWithContent};
|
||||||
|
|
||||||
use crate::insta_snapshot::snapshot_index_scheduler;
|
use crate::insta_snapshot::snapshot_index_scheduler;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use crate::json;
|
|
||||||
use meili_snap::{json_string, snapshot};
|
use meili_snap::{json_string, snapshot};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use crate::common::{shared_does_not_exists_index, Server};
|
use crate::common::{shared_does_not_exists_index, Server};
|
||||||
|
use crate::json;
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn create_and_get_index() {
|
async fn create_and_get_index() {
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
use meili_snap::*;
|
use meili_snap::*;
|
||||||
|
|
||||||
|
use super::test_settings_documents_indexing_swapping_and_search;
|
||||||
use crate::common::{shared_does_not_exists_index, Server, DOCUMENTS, NESTED_DOCUMENTS};
|
use crate::common::{shared_does_not_exists_index, Server, DOCUMENTS, NESTED_DOCUMENTS};
|
||||||
use crate::json;
|
use crate::json;
|
||||||
|
|
||||||
use super::test_settings_documents_indexing_swapping_and_search;
|
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn search_unexisting_index() {
|
async fn search_unexisting_index() {
|
||||||
let index = shared_does_not_exists_index().await;
|
let index = shared_does_not_exists_index().await;
|
||||||
|
@ -3,10 +3,10 @@ use meilisearch::Opt;
|
|||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
|
|
||||||
use super::test_settings_documents_indexing_swapping_and_search;
|
use super::test_settings_documents_indexing_swapping_and_search;
|
||||||
use crate::{
|
use crate::common::{
|
||||||
common::{default_settings, shared_index_with_documents, Server, DOCUMENTS, NESTED_DOCUMENTS},
|
default_settings, shared_index_with_documents, Server, DOCUMENTS, NESTED_DOCUMENTS,
|
||||||
json,
|
|
||||||
};
|
};
|
||||||
|
use crate::json;
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn search_with_filter_string_notation() {
|
async fn search_with_filter_string_notation() {
|
||||||
|
@ -2,11 +2,10 @@ use meili_snap::{json_string, snapshot};
|
|||||||
use meilisearch_types::milli::constants::RESERVED_GEO_FIELD_NAME;
|
use meilisearch_types::milli::constants::RESERVED_GEO_FIELD_NAME;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
|
|
||||||
|
use super::test_settings_documents_indexing_swapping_and_search;
|
||||||
use crate::common::{Server, Value};
|
use crate::common::{Server, Value};
|
||||||
use crate::json;
|
use crate::json;
|
||||||
|
|
||||||
use super::test_settings_documents_indexing_swapping_and_search;
|
|
||||||
|
|
||||||
static DOCUMENTS: Lazy<Value> = Lazy::new(|| {
|
static DOCUMENTS: Lazy<Value> = Lazy::new(|| {
|
||||||
json!([
|
json!([
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
use heed::Database;
|
use heed::{Database, DatabaseStat, RoTxn, Unspecified};
|
||||||
use heed::DatabaseStat;
|
|
||||||
use heed::RoTxn;
|
|
||||||
use heed::Unspecified;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::BEU32;
|
use crate::BEU32;
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
use heed::{
|
use heed::types::{SerdeJson, Str};
|
||||||
types::{SerdeJson, Str},
|
use heed::{RoTxn, RwTxn};
|
||||||
RoTxn, RwTxn,
|
|
||||||
};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{index::main_key, Index};
|
use crate::index::main_key;
|
||||||
|
use crate::Index;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use std::collections::BTreeSet;
|
use std::collections::{BTreeSet, HashMap};
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::{io, str};
|
use std::{io, str};
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
|
use std::collections::{BTreeSet, HashSet};
|
||||||
|
|
||||||
use deserr::{DeserializeError, Deserr, ValuePointerRef};
|
use deserr::{DeserializeError, Deserr, ValuePointerRef};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::{BTreeSet, HashSet};
|
|
||||||
use utoipa::ToSchema;
|
use utoipa::ToSchema;
|
||||||
|
|
||||||
use crate::{
|
use crate::attribute_patterns::{match_distinct_field, match_field_legacy, PatternMatch};
|
||||||
attribute_patterns::{match_distinct_field, match_field_legacy, PatternMatch},
|
use crate::constants::RESERVED_GEO_FIELD_NAME;
|
||||||
constants::RESERVED_GEO_FIELD_NAME,
|
use crate::AttributePatterns;
|
||||||
AttributePatterns,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, ToSchema)]
|
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, ToSchema)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use enum_iterator::Sequence;
|
|
||||||
use std::any::TypeId;
|
use std::any::TypeId;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
@ -6,6 +5,7 @@ use std::sync::atomic::{AtomicU32, Ordering};
|
|||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
|
use enum_iterator::Sequence;
|
||||||
use indexmap::IndexMap;
|
use indexmap::IndexMap;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
use std::collections::VecDeque;
|
||||||
|
|
||||||
use heed::types::{Bytes, Unit};
|
use heed::types::{Bytes, Unit};
|
||||||
use heed::{RoPrefix, RoTxn};
|
use heed::{RoPrefix, RoTxn};
|
||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
use rstar::RTree;
|
use rstar::RTree;
|
||||||
use std::collections::VecDeque;
|
|
||||||
|
|
||||||
use super::facet_string_values;
|
use super::facet_string_values;
|
||||||
use super::ranking_rules::{RankingRule, RankingRuleOutput, RankingRuleQueryTrait};
|
use super::ranking_rules::{RankingRule, RankingRuleOutput, RankingRuleQueryTrait};
|
||||||
|
@ -47,8 +47,7 @@ use sort::Sort;
|
|||||||
|
|
||||||
use self::distinct::facet_string_values;
|
use self::distinct::facet_string_values;
|
||||||
use self::geo_sort::GeoSort;
|
use self::geo_sort::GeoSort;
|
||||||
pub use self::geo_sort::Parameter as GeoSortParameter;
|
pub use self::geo_sort::{Parameter as GeoSortParameter, Strategy as GeoSortStrategy};
|
||||||
pub use self::geo_sort::Strategy as GeoSortStrategy;
|
|
||||||
use self::graph_based_ranking_rule::Words;
|
use self::graph_based_ranking_rule::Words;
|
||||||
use self::interner::Interned;
|
use self::interner::Interned;
|
||||||
use self::vector_sort::VectorSort;
|
use self::vector_sort::VectorSort;
|
||||||
|
@ -4,6 +4,7 @@ use serde_json::Value;
|
|||||||
|
|
||||||
use crate::attribute_patterns::PatternMatch;
|
use crate::attribute_patterns::PatternMatch;
|
||||||
use crate::fields_ids_map::metadata::Metadata;
|
use crate::fields_ids_map::metadata::Metadata;
|
||||||
|
use crate::filterable_attributes_rules::match_faceted_field;
|
||||||
use crate::update::new::document::Document;
|
use crate::update::new::document::Document;
|
||||||
use crate::update::new::extract::geo::extract_geo_coordinates;
|
use crate::update::new::extract::geo::extract_geo_coordinates;
|
||||||
use crate::update::new::extract::perm_json_p;
|
use crate::update::new::extract::perm_json_p;
|
||||||
@ -11,8 +12,6 @@ use crate::{
|
|||||||
FieldId, FilterableAttributesRule, GlobalFieldsIdsMap, InternalError, Result, UserError,
|
FieldId, FilterableAttributesRule, GlobalFieldsIdsMap, InternalError, Result, UserError,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::filterable_attributes_rules::match_faceted_field;
|
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn extract_document_facets<'doc>(
|
pub fn extract_document_facets<'doc>(
|
||||||
document: impl Document<'doc>,
|
document: impl Document<'doc>,
|
||||||
|
@ -18,7 +18,8 @@ pub use vectors::EmbeddingExtractor;
|
|||||||
pub mod perm_json_p {
|
pub mod perm_json_p {
|
||||||
use serde_json::{Map, Value};
|
use serde_json::{Map, Value};
|
||||||
|
|
||||||
use crate::{attribute_patterns::PatternMatch, Result};
|
use crate::attribute_patterns::PatternMatch;
|
||||||
|
use crate::Result;
|
||||||
const SPLIT_SYMBOL: char = '.';
|
const SPLIT_SYMBOL: char = '.';
|
||||||
|
|
||||||
/// Returns `true` if the `selector` match the `key`.
|
/// Returns `true` if the `selector` match the `key`.
|
||||||
|
@ -23,8 +23,8 @@ use crate::error::UserError;
|
|||||||
use crate::fields_ids_map::metadata::{FieldIdMapWithMetadata, MetadataBuilder};
|
use crate::fields_ids_map::metadata::{FieldIdMapWithMetadata, MetadataBuilder};
|
||||||
use crate::filterable_attributes_rules::match_faceted_field;
|
use crate::filterable_attributes_rules::match_faceted_field;
|
||||||
use crate::index::{
|
use crate::index::{
|
||||||
ChatConfig, IndexEmbeddingConfig, PrefixSearch,
|
ChatConfig, IndexEmbeddingConfig, PrefixSearch, SearchParameters,
|
||||||
SearchParameters, DEFAULT_MIN_WORD_LEN_ONE_TYPO, DEFAULT_MIN_WORD_LEN_TWO_TYPOS,
|
DEFAULT_MIN_WORD_LEN_ONE_TYPO, DEFAULT_MIN_WORD_LEN_TWO_TYPOS,
|
||||||
};
|
};
|
||||||
use crate::order_by_map::OrderByMap;
|
use crate::order_by_map::OrderByMap;
|
||||||
use crate::prompt::{default_max_bytes, default_template_text, PromptData};
|
use crate::prompt::{default_max_bytes, default_template_text, PromptData};
|
||||||
@ -1325,9 +1325,7 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> {
|
|||||||
Setting::NotSet => search_parameters.distinct.clone(),
|
Setting::NotSet => search_parameters.distinct.clone(),
|
||||||
},
|
},
|
||||||
matching_strategy: match matching_strategy {
|
matching_strategy: match matching_strategy {
|
||||||
Setting::Set(matching_strategy) => {
|
Setting::Set(matching_strategy) => Some(*matching_strategy),
|
||||||
Some(*matching_strategy)
|
|
||||||
}
|
|
||||||
Setting::Reset => None,
|
Setting::Reset => None,
|
||||||
Setting::NotSet => search_parameters.matching_strategy,
|
Setting::NotSet => search_parameters.matching_strategy,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user