diff options
Diffstat (limited to 'vendor/github.com/blevesearch/zapx/v11/posting.go')
-rw-r--r-- | vendor/github.com/blevesearch/zapx/v11/posting.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/github.com/blevesearch/zapx/v11/posting.go b/vendor/github.com/blevesearch/zapx/v11/posting.go index b7125e7c8a..6a8ead5264 100644 --- a/vendor/github.com/blevesearch/zapx/v11/posting.go +++ b/vendor/github.com/blevesearch/zapx/v11/posting.go @@ -657,13 +657,18 @@ func (i *PostingsIterator) nextDocNumAtOrAfter(atOrAfter uint64) (uint64, bool, return 0, false, nil } - if i.postings == nil || i.postings.postings == i.ActualBM { + if i.postings == nil || i.postings == emptyPostingsList { + // couldn't find anything + return 0, false, nil + } + + if i.postings.postings == i.ActualBM { return i.nextDocNumAtOrAfterClean(atOrAfter) } i.Actual.AdvanceIfNeeded(uint32(atOrAfter)) - if !i.Actual.HasNext() { + if !i.Actual.HasNext() || !i.all.HasNext() { // couldn't find anything return 0, false, nil } @@ -688,6 +693,10 @@ func (i *PostingsIterator) nextDocNumAtOrAfter(atOrAfter uint64) (uint64, bool, } } + if !i.all.HasNext() { + return 0, false, nil + } + allN = i.all.Next() } |