summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/blevesearch/bleve/document/field_numeric.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-02-18 08:50:26 +0800
committertechknowlogick <matti@mdranta.net>2019-02-17 19:50:26 -0500
commita380cfd8e03148a05859a7496d235fa14bde4796 (patch)
tree9ef2f4b66804e73e242d0d07fd30769898a0ca23 /vendor/github.com/blevesearch/bleve/document/field_numeric.go
parent11e316654e523bd668a20e1e6a95da3f5b9b22de (diff)
downloadgitea-a380cfd8e03148a05859a7496d235fa14bde4796.tar.gz
gitea-a380cfd8e03148a05859a7496d235fa14bde4796.zip
Update bleve dependency to latest master revision (#6100)
* update bleve to master b17287a86f6cac923a5d886e10618df994eeb54b6724eac2e3b8dde89cfbe3a2 * remove unused pkg from dep file * change bleve from master to recent revision
Diffstat (limited to 'vendor/github.com/blevesearch/bleve/document/field_numeric.go')
-rw-r--r--vendor/github.com/blevesearch/bleve/document/field_numeric.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/blevesearch/bleve/document/field_numeric.go b/vendor/github.com/blevesearch/bleve/document/field_numeric.go
index e32993c887..46c685e84e 100644
--- a/vendor/github.com/blevesearch/bleve/document/field_numeric.go
+++ b/vendor/github.com/blevesearch/bleve/document/field_numeric.go
@@ -16,11 +16,20 @@ package document
import (
"fmt"
+ "reflect"
"github.com/blevesearch/bleve/analysis"
"github.com/blevesearch/bleve/numeric"
+ "github.com/blevesearch/bleve/size"
)
+var reflectStaticSizeNumericField int
+
+func init() {
+ var f NumericField
+ reflectStaticSizeNumericField = int(reflect.TypeOf(f).Size())
+}
+
const DefaultNumericIndexingOptions = StoreField | IndexField | DocValues
const DefaultPrecisionStep uint = 4
@@ -33,6 +42,12 @@ type NumericField struct {
numPlainTextBytes uint64
}
+func (n *NumericField) Size() int {
+ return reflectStaticSizeNumericField + size.SizeOfPtr +
+ len(n.name) +
+ len(n.arrayPositions)*size.SizeOfPtr
+}
+
func (n *NumericField) Name() string {
return n.name
}