Skip to content

Commit

Permalink
update BlockMaxWandIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzq50 committed Dec 13, 2024
1 parent 6cd5f2b commit 214d207
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/storage/invertedindex/search/blockmax_wand_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module blockmax_wand_iterator;
import stl;
import third_party;
import index_defines;
import term_doc_iterator;
import blockmax_leaf_iterator;
import multi_doc_iterator;
import internal_types;
import logger;
Expand Down Expand Up @@ -55,9 +55,9 @@ BlockMaxWandIterator::BlockMaxWandIterator(Vector<UniquePtr<DocIterator>> &&iter
estimate_iterate_cost_ = {};
SizeT num_iterators = children_.size();
for (SizeT i = 0; i < num_iterators; i++){
TermDocIterator *tdi = dynamic_cast<TermDocIterator *>(children_[i].get());
BlockMaxLeafIterator *tdi = dynamic_cast<BlockMaxLeafIterator *>(children_[i].get());
if (tdi == nullptr) {
UnrecoverableError("BMW only supports TermDocIterator");
UnrecoverableError("BMW only supports BlockMaxLeafIterator");
}
bm25_score_upper_bound_ += tdi->BM25ScoreUpperBound();
estimate_iterate_cost_ += tdi->GetEstimateIterateCost();
Expand Down
6 changes: 3 additions & 3 deletions src/storage/invertedindex/search/blockmax_wand_iterator.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export module blockmax_wand_iterator;
import stl;
import index_defines;
import doc_iterator;
import term_doc_iterator;
import blockmax_leaf_iterator;
import multi_doc_iterator;
import internal_types;

Expand Down Expand Up @@ -50,8 +50,8 @@ private:
RowID common_block_min_possible_doc_id_{}; // not always exist
RowID common_block_last_doc_id_{};
float common_block_max_bm25_score_{};
Vector<TermDocIterator *> sorted_iterators_; // sort by DocID(), in ascending order
Vector<TermDocIterator *> backup_iterators_;
Vector<BlockMaxLeafIterator *> sorted_iterators_; // sort by DocID(), in ascending order
Vector<BlockMaxLeafIterator *> backup_iterators_;
SizeT pivot_;
// bm25 score cache
bool bm25_score_cached_ = false;
Expand Down

0 comments on commit 214d207

Please sign in to comment.