bugfixes more search results and dump restore options
This commit is contained in:
parent
f4fcf0d9a8
commit
3cd460318a
124 changed files with 3915 additions and 9579 deletions
19
vendor/github.com/blevesearch/bleve/numeric_util/prefix_coded.go
generated
vendored
19
vendor/github.com/blevesearch/bleve/numeric_util/prefix_coded.go
generated
vendored
|
|
@ -9,9 +9,7 @@
|
|||
|
||||
package numeric_util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
import "fmt"
|
||||
|
||||
const ShiftStartInt64 byte = 0x20
|
||||
|
||||
|
|
@ -72,3 +70,18 @@ func (p PrefixCoded) Int64() (int64, error) {
|
|||
}
|
||||
return int64(uint64((sortableBits << shift)) ^ 0x8000000000000000), nil
|
||||
}
|
||||
|
||||
func ValidPrefixCodedTerm(p string) (bool, int) {
|
||||
if len(p) > 0 {
|
||||
if p[0] < ShiftStartInt64 || p[0] > ShiftStartInt64+63 {
|
||||
return false, 0
|
||||
}
|
||||
shift := p[0] - ShiftStartInt64
|
||||
nChars := ((63 - int(shift)) / 7) + 1
|
||||
if len(p) != nChars+1 {
|
||||
return false, 0
|
||||
}
|
||||
return true, int(shift)
|
||||
}
|
||||
return false, 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue