mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-06 09:12:55 +00:00
Added disabling scoring
This commit is contained in:
@@ -41,7 +41,7 @@ impl TermQuery {
|
||||
num_docs: searcher.num_docs(),
|
||||
doc_freq: searcher.doc_freq(&self.term),
|
||||
term: self.term.clone(),
|
||||
index_record_option: self.index_record_option,
|
||||
index_record_option: self.index_record_option
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,8 @@ impl Query for TermQuery {
|
||||
fn weight(&self, searcher: &Searcher) -> Result<Box<Weight>> {
|
||||
Ok(box self.specialized_weight(searcher))
|
||||
}
|
||||
|
||||
fn disable_scoring(&mut self) {
|
||||
self.index_record_option = IndexRecordOption::Basic;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ pub struct TermWeight {
|
||||
pub(crate) num_docs: u32,
|
||||
pub(crate) doc_freq: u32,
|
||||
pub(crate) term: Term,
|
||||
pub(crate) index_record_option: IndexRecordOption,
|
||||
pub(crate) index_record_option: IndexRecordOption
|
||||
}
|
||||
|
||||
impl Weight for TermWeight {
|
||||
|
||||
Reference in New Issue
Block a user