mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Cargo fmt
This commit is contained in:
parent
830a7c0c7a
commit
178d00f93a
@ -1,7 +1,11 @@
|
|||||||
|
use std::borrow::Cow;
|
||||||
|
use std::collections::HashSet;
|
||||||
|
use std::io::BufReader;
|
||||||
|
|
||||||
|
use heed::types::ByteSlice;
|
||||||
|
|
||||||
use super::index_documents::{merge_cbo_roaring_bitmaps, CursorClonableMmap};
|
use super::index_documents::{merge_cbo_roaring_bitmaps, CursorClonableMmap};
|
||||||
use crate::{Index, Result};
|
use crate::{Index, Result};
|
||||||
use heed::types::ByteSlice;
|
|
||||||
use std::{borrow::Cow, collections::HashSet, io::BufReader};
|
|
||||||
|
|
||||||
mod prefix_word;
|
mod prefix_word;
|
||||||
mod word_prefix;
|
mod word_prefix;
|
||||||
@ -131,10 +135,11 @@ pub fn write_into_lmdb_database_without_merging(
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use std::io::Cursor;
|
||||||
|
|
||||||
use crate::db_snap;
|
use crate::db_snap;
|
||||||
use crate::documents::{DocumentsBatchBuilder, DocumentsBatchReader};
|
use crate::documents::{DocumentsBatchBuilder, DocumentsBatchReader};
|
||||||
use crate::index::tests::TempIndex;
|
use crate::index::tests::TempIndex;
|
||||||
use std::io::Cursor;
|
|
||||||
|
|
||||||
fn documents_with_enough_different_words_for_prefixes(prefixes: &[&str]) -> Vec<crate::Object> {
|
fn documents_with_enough_different_words_for_prefixes(prefixes: &[&str]) -> Vec<crate::Object> {
|
||||||
let mut documents = Vec::new();
|
let mut documents = Vec::new();
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
use std::borrow::Cow;
|
||||||
|
use std::collections::{BTreeMap, HashSet};
|
||||||
|
|
||||||
|
use grenad::CompressionType;
|
||||||
|
use heed::types::ByteSlice;
|
||||||
|
use heed::BytesDecode;
|
||||||
|
use log::debug;
|
||||||
|
|
||||||
use crate::update::index_documents::{create_writer, CursorClonableMmap};
|
use crate::update::index_documents::{create_writer, CursorClonableMmap};
|
||||||
use crate::update::prefix_word_pairs::{
|
use crate::update::prefix_word_pairs::{
|
||||||
insert_into_database, write_into_lmdb_database_without_merging,
|
insert_into_database, write_into_lmdb_database_without_merging,
|
||||||
};
|
};
|
||||||
use crate::{CboRoaringBitmapCodec, Result, U8StrStrCodec, UncheckedU8StrStrCodec};
|
use crate::{CboRoaringBitmapCodec, Result, U8StrStrCodec, UncheckedU8StrStrCodec};
|
||||||
use grenad::CompressionType;
|
|
||||||
use heed::types::ByteSlice;
|
|
||||||
use heed::BytesDecode;
|
|
||||||
use log::debug;
|
|
||||||
use std::borrow::Cow;
|
|
||||||
use std::collections::{BTreeMap, HashSet};
|
|
||||||
|
|
||||||
#[logging_timer::time]
|
#[logging_timer::time]
|
||||||
pub fn index_prefix_word_database(
|
pub fn index_prefix_word_database(
|
||||||
|
@ -163,17 +163,19 @@ Writer instead of the DB. At the end of the outer loop, we finally read from
|
|||||||
the grenad and insert its elements in the database.
|
the grenad and insert its elements in the database.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use std::borrow::Cow;
|
||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
|
use grenad::CompressionType;
|
||||||
|
use heed::types::ByteSlice;
|
||||||
|
use heed::BytesDecode;
|
||||||
|
use log::debug;
|
||||||
|
|
||||||
use crate::update::index_documents::{create_writer, CursorClonableMmap};
|
use crate::update::index_documents::{create_writer, CursorClonableMmap};
|
||||||
use crate::update::prefix_word_pairs::{
|
use crate::update::prefix_word_pairs::{
|
||||||
insert_into_database, write_into_lmdb_database_without_merging,
|
insert_into_database, write_into_lmdb_database_without_merging,
|
||||||
};
|
};
|
||||||
use crate::{CboRoaringBitmapCodec, Result, U8StrStrCodec, UncheckedU8StrStrCodec};
|
use crate::{CboRoaringBitmapCodec, Result, U8StrStrCodec, UncheckedU8StrStrCodec};
|
||||||
use grenad::CompressionType;
|
|
||||||
use heed::types::ByteSlice;
|
|
||||||
use heed::BytesDecode;
|
|
||||||
use log::debug;
|
|
||||||
use std::borrow::Cow;
|
|
||||||
use std::collections::HashSet;
|
|
||||||
|
|
||||||
#[logging_timer::time]
|
#[logging_timer::time]
|
||||||
pub fn index_word_prefix_database(
|
pub fn index_word_prefix_database(
|
||||||
@ -562,9 +564,10 @@ impl PrefixTrieNode {
|
|||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use roaring::RoaringBitmap;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{CboRoaringBitmapCodec, U8StrStrCodec};
|
use crate::{CboRoaringBitmapCodec, U8StrStrCodec};
|
||||||
use roaring::RoaringBitmap;
|
|
||||||
|
|
||||||
fn check_prefixes(
|
fn check_prefixes(
|
||||||
trie: &PrefixTrieNode,
|
trie: &PrefixTrieNode,
|
||||||
|
Loading…
Reference in New Issue
Block a user