This needs to be moved to the implementation of vector-indexer API
(ctx context.Context, rb *IndexRebuild)
| 1693 | |
| 1694 | // This needs to be moved to the implementation of vector-indexer API |
| 1695 | func prefixesToDropVectorIndexEdges(ctx context.Context, rb *IndexRebuild) [][]byte { |
| 1696 | // Exit early if indices do not need to be rebuilt. |
| 1697 | op := rb.needsVectorIndexEdgesRebuild() |
| 1698 | if op == indexNoop { |
| 1699 | return nil |
| 1700 | } |
| 1701 | |
| 1702 | prefixes := append([][]byte{}, x.PredicatePrefix(hnsw.ConcatStrings(rb.Attr, hnsw.VecEntry))) |
| 1703 | prefixes = append(prefixes, x.PredicatePrefix(hnsw.ConcatStrings(rb.Attr, hnsw.VecDead))) |
| 1704 | prefixes = append(prefixes, x.PredicatePrefix(hnsw.ConcatStrings(rb.Attr, hnsw.VecKeyword))) |
| 1705 | |
| 1706 | for i := range hnsw.VectorIndexMaxLevels { |
| 1707 | prefixes = append(prefixes, x.PredicatePrefix(hnsw.ConcatStrings(rb.Attr, hnsw.VecKeyword, fmt.Sprint(i)))) |
| 1708 | } |
| 1709 | |
| 1710 | return prefixes |
| 1711 | } |
| 1712 | |
| 1713 | func (rb *IndexRebuild) needsReverseEdgesRebuild() indexOp { |
| 1714 | x.AssertTruef(rb.CurrentSchema != nil, "Current schema cannot be nil.") |
no test coverage detected