mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-03-06 13:51:03 +08:00
Expose a new indexer parameter to enable the creation of a document dictionary
This commit is contained in:
parent
bbbc4410ac
commit
83616bc03e
@ -60,6 +60,7 @@ where
|
||||
let number_of_documents = index.number_of_documents(wtxn)? as usize;
|
||||
match index.document_compression_raw_dictionary(wtxn)? {
|
||||
Some(dict) => Ok(Some(EncoderDictionary::copy(dict, COMPRESSION_LEVEL))),
|
||||
None if !indexing_context.allow_creating_compression_dictionary => Ok(None),
|
||||
None if number_of_documents >= COMPRESS_LIMIT => Ok(None),
|
||||
None if number_of_documents + document_changes.len() < SAMPLE_SIZE => Ok(None),
|
||||
None => {
|
||||
|
@ -146,6 +146,7 @@ pub struct IndexingContext<
|
||||
{
|
||||
pub index: &'index Index,
|
||||
pub db_fields_ids_map: &'indexer FieldsIdsMap,
|
||||
pub allow_creating_compression_dictionary: bool,
|
||||
pub db_document_decompression_dictionary: Option<&'indexer DecoderDictionary<'static>>,
|
||||
pub new_fields_ids_map: &'fid RwLock<FieldIdMapWithMetadata>,
|
||||
pub doc_allocs: &'indexer ThreadLocal<FullySend<Cell<Bump>>>,
|
||||
@ -210,6 +211,7 @@ pub fn extract<
|
||||
IndexingContext {
|
||||
index,
|
||||
db_fields_ids_map,
|
||||
allow_creating_compression_dictionary,
|
||||
db_document_decompression_dictionary,
|
||||
new_fields_ids_map,
|
||||
doc_allocs,
|
||||
|
@ -108,6 +108,7 @@ where
|
||||
let indexing_context = IndexingContext {
|
||||
index,
|
||||
db_fields_ids_map,
|
||||
allow_creating_compression_dictionary,
|
||||
db_document_decompression_dictionary: db_document_decompression_dictionary.as_ref(),
|
||||
new_fields_ids_map: &new_fields_ids_map,
|
||||
doc_allocs: &doc_allocs,
|
||||
|
Loading…
x
Reference in New Issue
Block a user