MCPcopy
hub / github.com/dgraph-io/dgraph / matchStrings

Function matchStrings

worker/stringfilter.go:31–48  ·  view source on GitHub ↗
(uids *pb.List, values [][]types.Val, filter *stringFilter)

Source from the content-addressed store, hash-verified

29}
30
31func matchStrings(uids *pb.List, values [][]types.Val, filter *stringFilter) *pb.List {
32 rv := &pb.List{}
33 if filter == nil {
34 // Handle a nil filter as filtering all the elements out.
35 return rv
36 }
37
38 for i := range values {
39 for j := range values[i] {
40 if filter.match(values[i][j], filter) {
41 rv.Uids = append(rv.Uids, uids.Uids[i])
42 break
43 }
44 }
45 }
46
47 return rv
48}
49
50func defaultMatch(value types.Val, filter *stringFilter) bool {
51 tokenMap := map[string]bool{}

Callers 1

filterStringFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected