Make sure that automatons group with more automatons are better

This commit is contained in:
Clément Renault 2019-10-24 14:20:07 +02:00
parent 44c89b1ea2
commit cb5c77e536
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
2 changed files with 6 additions and 5 deletions

View File

@ -284,7 +284,11 @@ fn generate_automatons(
// we keep the original automatons at the front.
automatons[1..].sort_by_key(|group| {
let a = group.automatons.first().unwrap();
(Reverse(a.is_exact), a.ngram)
(
Reverse(a.is_exact),
a.ngram,
Reverse(group.automatons.len()),
)
});
Ok((automatons, enhancer_builder.build()))

View File

@ -1,8 +1,5 @@
use meilidb_schema::{Diff, Schema};
use crate::update::documents_addition::reindex_all_documents;
use crate::update::{next_update_id, Update};
use crate::{error::UnsupportedOperation, store, MResult, RankedMap};
use crate::{store, MResult, RankedMap};
pub fn apply_clear_all(
writer: &mut heed::RwTxn,