Upgrade bleve from v2.0.6 to v2.3.0 (#18132)

This commit is contained in:
Lunny Xiao 2022-01-01 16:26:27 +08:00 committed by GitHub
parent 1a4e2bfcd1
commit 25a290e320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 1283 additions and 660 deletions

View file

@ -1552,3 +1552,27 @@ func (rb *Bitmap) Stats() Statistics {
}
return stats
}
func (rb *Bitmap) checkValidity() bool {
for _, c := range rb.highlowcontainer.containers {
switch c.(type) {
case *arrayContainer:
if c.getCardinality() > arrayDefaultMaxSize {
fmt.Println("Array containers are limited to size ", arrayDefaultMaxSize)
return false
}
case *bitmapContainer:
if c.getCardinality() <= arrayDefaultMaxSize {
fmt.Println("Bitmaps would be more concise as an array!")
return false
}
case *runContainer16:
if c.getSizeInBytes() > minOfInt(bitmapContainerSizeInBytes(), arrayContainerSizeInBytes(c.getCardinality())) {
fmt.Println("Inefficient run container!")
return false
}
}
}
return true
}