Skip to content

Commit 1d2f8e6

Browse files
added filter for vector lengths
1 parent 9338d9a commit 1d2f8e6

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

posting/index.go

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,16 @@ func (mp *MutationPipeline) InsertTokenizerIndexes(ctx context.Context, pipeline
110110
pipeline.errCh <- err
111111
return
112112
}
113-
indexEdge := &pb.DirectedEdge{
114-
Attr: pipeline.attr,
115-
}
113+
116114
if len(tokenizers) == 0 {
117115
return
118116
}
119117

120118
values := make(map[string]*pb.PostingList, len(tokenizers)*len(*postings))
121119
valPost := make(map[string]*pb.Posting)
122-
info := &indexMutationInfo{
123-
tokenizers: tokenizers,
124-
factorySpecs: factorySpecs,
125-
op: pb.DirectedEdge_SET,
120+
121+
indexEdge1 := &pb.DirectedEdge{
122+
Attr: pipeline.attr,
126123
}
127124

128125
for uid, postingList := range *postings {
@@ -133,10 +130,10 @@ func (mp *MutationPipeline) InsertTokenizerIndexes(ctx context.Context, pipeline
133130
valPl = &pb.PostingList{}
134131
}
135132

136-
indexEdge.Op = GetPostingOp(posting.Op)
137-
indexEdge.ValueId = uid
133+
indexEdge1.Op = GetPostingOp(posting.Op)
134+
indexEdge1.ValueId = uid
138135

139-
mpost := makePostingFromEdge(mp.txn.StartTs, indexEdge)
136+
mpost := makePostingFromEdge(mp.txn.StartTs, indexEdge1)
140137
valPl.Postings = append(valPl.Postings, mpost)
141138
values[string(posting.Value)] = valPl
142139

@@ -158,8 +155,19 @@ func (mp *MutationPipeline) InsertTokenizerIndexes(ctx context.Context, pipeline
158155
f := func(numGo int) *types.LockedShardedMap[string, *pb.PostingList] {
159156
wg := &sync.WaitGroup{}
160157

158+
indexEdge := &pb.DirectedEdge{
159+
Attr: pipeline.attr,
160+
}
161+
161162
globalMap := types.NewLockedShardedMap[string, *pb.PostingList]()
162163
process := func(start int) {
164+
165+
info := &indexMutationInfo{
166+
tokenizers: tokenizers,
167+
factorySpecs: factorySpecs,
168+
op: pb.DirectedEdge_SET,
169+
}
170+
163171
defer wg.Done()
164172
localMap := make(map[string]*pb.PostingList, len(values)/numGo)
165173
for i := start; i < len(values); i += numGo {

0 commit comments

Comments
 (0)