diff options
Diffstat (limited to 'src/result.go')
-rw-r--r-- | src/result.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/result.go b/src/result.go index 0b1fbf0d..fd4d1a98 100644 --- a/src/result.go +++ b/src/result.go @@ -34,7 +34,7 @@ func buildResult(item *Item, offsets []Offset, score int) *Result { sort.Sort(ByOrder(offsets)) } - result := Result{item: item, rank: rank{index: item.index}} + result := Result{item: item, rank: rank{index: item.Index()}} numChars := item.text.Length() minBegin := math.MaxUint16 minEnd := math.MaxUint16 @@ -57,7 +57,7 @@ func buildResult(item *Item, offsets []Offset, score int) *Result { // Higher is better val = math.MaxUint16 - util.AsUint16(score) case byLength: - val = util.AsUint16(int(item.TrimLength())) + val = item.TrimLength() case byBegin, byEnd: if validOffsetFound { whitePrefixLen := 0 @@ -86,7 +86,7 @@ var sortCriteria []criterion // Index returns ordinal index of the Item func (result *Result) Index() int32 { - return result.item.index + return result.item.Index() } func minRank() rank { |