term_freq in TermFrequencyRecorder untested

PR to demonstrate #2285
This commit is contained in:
Pascal Seitz
2023-12-20 23:38:46 +08:00
parent bff7c58497
commit dd57b7fa3a

View File

@@ -213,7 +213,7 @@ impl Recorder for TermFrequencyRecorder {
doc_id_and_tf.sort_unstable_by_key(|&(doc_id, _)| doc_id);
for (doc_id, tf) in doc_id_and_tf {
serializer.write_doc(doc_id, tf, &[][..]);
serializer.write_doc(doc_id, 0, &[][..]);
}
} else {
let mut prev_doc = 0;
@@ -221,7 +221,7 @@ impl Recorder for TermFrequencyRecorder {
let doc_id = prev_doc + delta_doc_id;
prev_doc = doc_id;
let term_freq = u32_it.next().unwrap_or(self.current_tf);
serializer.write_doc(doc_id, term_freq, &[][..]);
serializer.write_doc(doc_id, 0, &[][..]);
}
}
}