summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/blevesearch/zapx/v15/posting.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-01-01 16:26:27 +0800
committerGitHub <noreply@github.com>2022-01-01 16:26:27 +0800
commit25a290e320de630eaf8ef4e56bb435c1ecfe1032 (patch)
treedf450bc27eed27236f78661ca141c686d4fe8863 /vendor/github.com/blevesearch/zapx/v15/posting.go
parent1a4e2bfcd115ada6cb859cb87964c227e0e082b9 (diff)
downloadgitea-25a290e320de630eaf8ef4e56bb435c1ecfe1032.tar.gz
gitea-25a290e320de630eaf8ef4e56bb435c1ecfe1032.zip
Upgrade bleve from v2.0.6 to v2.3.0 (#18132)
Diffstat (limited to 'vendor/github.com/blevesearch/zapx/v15/posting.go')
-rw-r--r--vendor/github.com/blevesearch/zapx/v15/posting.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/github.com/blevesearch/zapx/v15/posting.go b/vendor/github.com/blevesearch/zapx/v15/posting.go
index b1d19e532d..484bd0e148 100644
--- a/vendor/github.com/blevesearch/zapx/v15/posting.go
+++ b/vendor/github.com/blevesearch/zapx/v15/posting.go
@@ -562,13 +562,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
}
@@ -592,6 +597,10 @@ func (i *PostingsIterator) nextDocNumAtOrAfter(atOrAfter uint64) (uint64, bool,
}
}
+ if !i.all.HasNext() {
+ return 0, false, nil
+ }
+
allN = i.all.Next()
}