mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 18:45:06 +08:00
Retrieve the previous version of the words prefixes FST
This commit is contained in:
parent
38d23546a5
commit
d28f18658e
@ -353,6 +353,9 @@ where
|
|||||||
total_databases: TOTAL_POSTING_DATABASE_COUNT,
|
total_databases: TOTAL_POSTING_DATABASE_COUNT,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let previous_words_prefixes_fst =
|
||||||
|
self.index.words_prefixes_fst(self.wtxn)?.map_data(|cow| cow.into_owned())?;
|
||||||
|
|
||||||
// Run the words prefixes update operation.
|
// Run the words prefixes update operation.
|
||||||
let mut builder = WordsPrefixesFst::new(self.wtxn, self.index);
|
let mut builder = WordsPrefixesFst::new(self.wtxn, self.index);
|
||||||
if let Some(value) = self.config.words_prefix_threshold {
|
if let Some(value) = self.config.words_prefix_threshold {
|
||||||
@ -389,7 +392,7 @@ where
|
|||||||
builder.chunk_compression_level = self.indexer_config.chunk_compression_level;
|
builder.chunk_compression_level = self.indexer_config.chunk_compression_level;
|
||||||
builder.max_nb_chunks = self.indexer_config.max_nb_chunks;
|
builder.max_nb_chunks = self.indexer_config.max_nb_chunks;
|
||||||
builder.max_memory = self.indexer_config.max_memory;
|
builder.max_memory = self.indexer_config.max_memory;
|
||||||
builder.execute()?;
|
builder.execute(&previous_words_prefixes_fst)?;
|
||||||
|
|
||||||
databases_seen += 1;
|
databases_seen += 1;
|
||||||
(self.progress)(UpdateIndexingStep::MergeDataIntoFinalDatabase {
|
(self.progress)(UpdateIndexingStep::MergeDataIntoFinalDatabase {
|
||||||
|
@ -61,7 +61,7 @@ impl<'t, 'u, 'i> WordPrefixPairProximityDocids<'t, 'u, 'i> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[logging_timer::time("WordPrefixPairProximityDocids::{}")]
|
#[logging_timer::time("WordPrefixPairProximityDocids::{}")]
|
||||||
pub fn execute(self) -> Result<()> {
|
pub fn execute<A: AsRef<[u8]>>(self, old_prefix_fst: &fst::Set<A>) -> Result<()> {
|
||||||
debug!("Computing and writing the word prefix pair proximity docids into LMDB on disk...");
|
debug!("Computing and writing the word prefix pair proximity docids into LMDB on disk...");
|
||||||
|
|
||||||
self.index.word_prefix_pair_proximity_docids.clear(self.wtxn)?;
|
self.index.word_prefix_pair_proximity_docids.clear(self.wtxn)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user