Repository: quickwit-oss/tantivy (language: rust)

Issue:
cleanup read_postings_no_deletes
`read_postings_no_deletes` seems to be residue of an older API and has no functionality currently


Discussion / hints:

Fix patch:
diff --git a/src/index/inverted_index_reader.rs b/src/index/inverted_index_reader.rs
index 76dbca9fb9..a288df3444 100644
--- a/src/index/inverted_index_reader.rs
+++ b/src/index/inverted_index_reader.rs
@@ -205,16 +205,6 @@ impl InvertedIndexReader {
             .transpose()
     }
 
-    pub(crate) fn read_postings_no_deletes(
-        &self,
-        term: &Term,
-        option: IndexRecordOption,
-    ) -> io::Result<Option<SegmentPostings>> {
-        self.get_term_info(term)?
-            .map(|term_info| self.read_postings_from_terminfo(&term_info, option))
-            .transpose()
-    }
-
     /// Returns the number of documents containing the term.
     pub fn doc_freq(&self, term: &Term) -> io::Result<u32> {
         Ok(self
diff --git a/src/query/phrase_prefix_query/phrase_prefix_weight.rs b/src/query/phrase_prefix_query/phrase_prefix_weight.rs
index 866c3c2c5a..546eb89e8e 100644
--- a/src/query/phrase_prefix_query/phrase_prefix_weight.rs
+++ b/src/query/phrase_prefix_query/phrase_prefix_weight.rs
@@ -53,27 +53,14 @@ impl PhrasePrefixWeight {
             .map(|similarity_weight| similarity_weight.boost_by(boost));
         let fieldnorm_reader = self.fieldnorm_reader(reader)?;
         let mut term_postings_list = Vec::new();
-        if reader.has_deletes() {
-            for &(offset, ref term) in &self.phrase_terms {
-                if let Some(postings) = reader
-                    .inverted_index(term.field())?
-                    .read_postings(term, IndexRecordOption::WithFreqsAndPositions)?
-                {
-                    term_postings_list.push((offset, postings));
-                } else {
-                    return Ok(None);
-                }
-            }
-        } else {
-            for &(offset, ref term) in &self.phrase_terms {
-                if let Some(postings) = reader
-                    .inverted_index(term.field())?
-                    .read_postings_no_deletes(term, IndexRecordOption::WithFreqsAndPositions)?
-                {
-                    term_postings_list.push((offset, postings));
-                } else {
-                    return Ok(None);
-                }
+        for &(offset, ref term) in &self.phrase_terms {
+            if let Some(postings) = reader
+                .inverted_index(term.field())?
+                .read_postings(term, IndexRecordOption::WithFreqsAndPositions)?
+            {
+                term_postings_list.push((offset, postings));
+            } else {
+                return Ok(None);
             }
         }
 
@@ -109,8 +96,8 @@ impl PhrasePrefixWeight {
                 {
                     suffixes.push(postings);
                 }
-            } else if let Some(postings) = inv_index
-                .read_postings_no_deletes(&new_term, IndexRecordOption::WithFreqsAndPositions)?
+            } else if let Some(postings) =
+                inv_index.read_postings(&new_term, IndexRecordOption::WithFreqsAndPositions)?
             {
                 suffixes.push(postings);
             }


Test patch: