mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 13:24:27 +01:00
Only run word pair proximity docids extraction if proximity_precision enables it
This commit is contained in:
parent
8371819114
commit
132916f62c
@ -26,10 +26,11 @@ use super::words_prefix_docids::{
|
|||||||
use super::{StdResult, TopLevelMap};
|
use super::{StdResult, TopLevelMap};
|
||||||
use crate::documents::{PrimaryKey, DEFAULT_PRIMARY_KEY};
|
use crate::documents::{PrimaryKey, DEFAULT_PRIMARY_KEY};
|
||||||
use crate::facet::FacetType;
|
use crate::facet::FacetType;
|
||||||
|
use crate::proximity::ProximityPrecision;
|
||||||
use crate::update::new::channel::ExtractorSender;
|
use crate::update::new::channel::ExtractorSender;
|
||||||
use crate::update::settings::InnerIndexSettings;
|
use crate::update::settings::InnerIndexSettings;
|
||||||
use crate::update::{FacetsUpdateBulk, GrenadParameters};
|
use crate::update::{FacetsUpdateBulk, GrenadParameters};
|
||||||
use crate::{FieldsIdsMap, GlobalFieldsIdsMap, Index, Result, UserError};
|
use crate::{Error, FieldsIdsMap, GlobalFieldsIdsMap, Index, Result, UserError};
|
||||||
|
|
||||||
mod de;
|
mod de;
|
||||||
pub mod document_changes;
|
pub mod document_changes;
|
||||||
@ -184,7 +185,11 @@ where
|
|||||||
extractor_sender.send_searchable::<FidWordCountDocids>(fid_word_count_docids).unwrap();
|
extractor_sender.send_searchable::<FidWordCountDocids>(fid_word_count_docids).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
// run the proximity extraction only if the precision is by word
|
||||||
|
// this works only if the settings didn't change during this transaction.
|
||||||
|
let rtxn = index.read_txn().unwrap();
|
||||||
|
let proximity_precision = index.proximity_precision(&rtxn)?.unwrap_or_default();
|
||||||
|
if proximity_precision == ProximityPrecision::ByWord {
|
||||||
let span = tracing::trace_span!(target: "indexing::documents::extract", "word_pair_proximity_docids");
|
let span = tracing::trace_span!(target: "indexing::documents::extract", "word_pair_proximity_docids");
|
||||||
let _entered = span.enter();
|
let _entered = span.enter();
|
||||||
extract_and_send_docids::<
|
extract_and_send_docids::<
|
||||||
|
Loading…
Reference in New Issue
Block a user