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

Function EncodeInvertedIndexKeys

pkg/util/tsearch/encoding.go:456–465  ·  view source on GitHub ↗

EncodeInvertedIndexKeys returns a slice of byte slices, one per inverted index key for the terms in this tsvector.

(inKey []byte, vector TSVector)

Source from the content-addressed store, hash-verified

454// EncodeInvertedIndexKeys returns a slice of byte slices, one per inverted
455// index key for the terms in this tsvector.
456func EncodeInvertedIndexKeys(inKey []byte, vector TSVector) ([][]byte, error) {
457 outKeys := make([][]byte, 0, len(vector))
458 // Note that by construction, TSVector contains only unique terms, so we don't
459 // need to de-duplicate terms when constructing the inverted index keys.
460 for i := range vector {
461 newKey := EncodeInvertedIndexKey(inKey, vector[i].lexeme)
462 outKeys = append(outKeys, newKey)
463 }
464 return outKeys, nil
465}
466
467// EncodeInvertedIndexKey returns the inverted index key for the input lexeme.
468func EncodeInvertedIndexKey(inKey []byte, lexeme string) []byte {

Callers

nothing calls this directly

Calls 1

EncodeInvertedIndexKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…