aboutsummaryrefslogtreecommitdiff
path: root/icing/index/numeric/integer-index-storage.cc
diff options
context:
space:
mode:
Diffstat (limited to 'icing/index/numeric/integer-index-storage.cc')
-rw-r--r--icing/index/numeric/integer-index-storage.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/icing/index/numeric/integer-index-storage.cc b/icing/index/numeric/integer-index-storage.cc
index f3901e1..5165040 100644
--- a/icing/index/numeric/integer-index-storage.cc
+++ b/icing/index/numeric/integer-index-storage.cc
@@ -292,12 +292,17 @@ libtextclassifier3::Status IntegerIndexStorageIterator::Advance() {
// Merge sections with same document_id into a single DocHitInfo
while (!pq_.empty() &&
pq_.top()->GetCurrentBasicHit().document_id() == document_id) {
- doc_hit_info_.UpdateSection(pq_.top()->GetCurrentBasicHit().section_id());
-
BucketPostingListIterator* bucket_itr = pq_.top();
pq_.pop();
- if (bucket_itr->AdvanceAndFilter(key_lower_, key_upper_).ok()) {
+ libtextclassifier3::Status advance_status;
+ do {
+ doc_hit_info_.UpdateSection(
+ bucket_itr->GetCurrentBasicHit().section_id());
+ advance_status = bucket_itr->AdvanceAndFilter(key_lower_, key_upper_);
+ } while (advance_status.ok() &&
+ bucket_itr->GetCurrentBasicHit().document_id() == document_id);
+ if (advance_status.ok()) {
pq_.push(bucket_itr);
}
}