Skip to content

Commit 25eae36

Browse files
added filter for vector lengths
1 parent 52f3de4 commit 25eae36

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

posting/index.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ func (mp *MutationPipeline) InsertTokenizerIndexes(ctx context.Context, pipeline
234234
mp.txn.cache.Lock()
235235
defer mp.txn.cache.Unlock()
236236

237-
// if info.hasUpsert {
238-
// globalMapI.Iterate(func(key string, value *pb.PostingList) error {
239-
// mp.txn.addConflictKey(farm.Fingerprint64([]byte(key)))
240-
// return nil
241-
// })
242-
// }
237+
if info.hasUpsert {
238+
globalMapI.Iterate(func(key string, value *pb.PostingList) error {
239+
mp.txn.addConflictKey(farm.Fingerprint64([]byte(key)))
240+
return nil
241+
})
242+
}
243243

244244
globalMap := mp.txn.cache.deltas.GetIndexMapForPredicate(pipeline.attr)
245245
if globalMap == nil {
@@ -378,7 +378,9 @@ func (mp *MutationPipeline) ProcessReverse(ctx context.Context, pipeline *Predic
378378
}
379379

380380
if info.count {
381-
return mp.ProcessCount(ctx, pipeline, &reverseredMap, info)
381+
newInfo := info
382+
newInfo.isList = true
383+
return mp.ProcessCount(ctx, pipeline, &reverseredMap, newInfo)
382384
}
383385

384386
for uid, pl := range reverseredMap {
@@ -457,14 +459,14 @@ func (txn *Txn) addConflictKeyWithUid(key []byte, pl *pb.PostingList, hasUpsert
457459
if txn.conflicts == nil {
458460
txn.conflicts = make(map[uint64]struct{})
459461
}
460-
// keyHash := farm.Fingerprint64(key)
461-
// // if hasUpsert {
462-
// // txn.conflicts[keyHash] = struct{}{}
463-
// // return
464-
// // }
465-
// for _, post := range pl.Postings {
466-
// txn.conflicts[keyHash^post.Uid] = struct{}{}
462+
keyHash := farm.Fingerprint64(key)
463+
// if hasUpsert {
464+
// txn.conflicts[keyHash] = struct{}{}
465+
// return
467466
// }
467+
for _, post := range pl.Postings {
468+
txn.conflicts[keyHash^post.Uid] = struct{}{}
469+
}
468470
}
469471

470472
func (mp *MutationPipeline) ProcessCount(ctx context.Context, pipeline *PredicatePipeline, postings *map[uint64]*pb.PostingList, info predicateInfo) error {

0 commit comments

Comments
 (0)