0
0
Fork 0

Merge pull request #828 from blevesearch/minor_fixes

posting iterator array positions clean up
This commit is contained in:
Steve Yen 2018-03-15 09:31:15 -07:00 committed by GitHub
commit d1b84d4578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -117,14 +117,14 @@ func (o *MergePlanOptions) RaiseToFloorSegmentSize(s int64) int64 {
}
// MaxSegmentSizeLimit represents the maximum size of a segment,
// this limit comes as the roaring lib supports uint32.
const MaxSegmentSizeLimit = 1<<32 - 1
// this limit comes with hit-1 optimisation/max encoding limit uint31.
const MaxSegmentSizeLimit = 1<<31 - 1
// ErrMaxSegmentSizeTooLarge is returned when the size of the segment
// exceeds the MaxSegmentSizeLimit
var ErrMaxSegmentSizeTooLarge = errors.New("MaxSegmentSize exceeds the size limit")
// Suggested default options.
// DefaultMergePlanOptions suggests the default options.
var DefaultMergePlanOptions = MergePlanOptions{
MaxSegmentsPerTier: 10,
MaxSegmentSize: 5000000,

View File

@ -444,6 +444,8 @@ func (i *PostingsIterator) readLocation(l *Location) error {
l.end = end
if numArrayPos > 0 {
l.ap = make([]uint64, int(numArrayPos))
} else {
l.ap = l.ap[:0]
}
}