EncodeInvertedIndexKeys returns a slice of byte slices, one per inverted index key for the terms in this tsvector.
(inKey []byte, vector TSVector)
| 454 | // EncodeInvertedIndexKeys returns a slice of byte slices, one per inverted |
| 455 | // index key for the terms in this tsvector. |
| 456 | func 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. |
| 468 | func EncodeInvertedIndexKey(inKey []byte, lexeme string) []byte { |
nothing calls this directly
no test coverage detected
searching dependent graphs…