MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / tsWeightFromVectorPGEncoding

Function tsWeightFromVectorPGEncoding

pkg/util/tsearch/tsvector.go:140–153  ·  view source on GitHub ↗
(b byte)

Source from the content-addressed store, hash-verified

138}
139
140func tsWeightFromVectorPGEncoding(b byte) (tsWeight, error) {
141 switch b {
142 case 3:
143 return weightA, nil
144 case 2:
145 return weightB, nil
146 case 1:
147 return weightC, nil
148 case 0:
149 // We don't explicitly return weightD, since it's the default.
150 return 0, nil
151 }
152 return 0, errors.Errorf("invalid encoded tsvector weight %d", b)
153}
154
155// tsPosition is a position within a document, along with an optional weight.
156type tsPosition struct {

Callers 2

DecodeTSVectorFunction · 0.85
DecodeTSVectorPGBinaryFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…