Skip to content

Commit

Permalink
TMEP
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzadlone committed Feb 1, 2024
1 parent 81a72ce commit 6d4c88f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions db/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package fetcher
import (
"bytes"
"context"
"fmt"
"strings"

"github.com/bits-and-blooms/bitset"
Expand Down Expand Up @@ -599,7 +600,15 @@ func (df *DocumentFetcher) fetchNext(ctx context.Context) (EncodedDocument, Exec
return nil, ExecInfo{}, err
}

if df.filter != nil {
// Check permission
s := df.kv.Key.DocID
fmt.Println("------------------------------------")
fmt.Println("s : ", s)
fmt.Println("passedPermission : ", df.passedPermission)
df.passedPermission = true
fmt.Println("------------------------------------")

if df.passedPermission && df.filter != nil {
// only run filter if we've collected all the fields
// required for filtering. This is tracked by the bitsets.
if df.filterSet.Equal(df.doc.filterSet) {
Expand All @@ -619,7 +628,7 @@ func (df *DocumentFetcher) fetchNext(ctx context.Context) (EncodedDocument, Exec
// if we don't pass the filter (ran and pass)
// theres no point in collecting other select fields
// so we seek to the next doc
spansDone, docDone, err := df.nextKey(ctx, !df.passedFilter && df.ranFilter)
spansDone, docDone, err := df.nextKey(ctx, !df.passedPermission || !df.passedFilter && df.ranFilter)
if err != nil {
return nil, ExecInfo{}, err
}
Expand Down

0 comments on commit 6d4c88f

Please sign in to comment.