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

Function needsStringFiltering

worker/task.go:1205–1220  ·  view source on GitHub ↗
(srcFn *functionContext, langs []string, attr string)

Source from the content-addressed store, hash-verified

1203}
1204
1205func needsStringFiltering(srcFn *functionContext, langs []string, attr string) bool {
1206 if !srcFn.isStringFn {
1207 return false
1208 }
1209
1210 // If a predicate doesn't have @lang directive in schema, we don't need to do any string
1211 // filtering.
1212 if !schema.State().HasLang(attr) {
1213 return false
1214 }
1215
1216 return langForFunc(langs) != "." &&
1217 (srcFn.fnType == standardFn || srcFn.fnType == hasFn ||
1218 srcFn.fnType == fullTextSearchFn || srcFn.fnType == compareAttrFn ||
1219 srcFn.fnType == customIndexFn || srcFn.fnType == ngramFn)
1220}
1221
1222func (qs *queryState) handleCompareScalarFunction(ctx context.Context, arg funcArgs) error {
1223 attr := arg.q.Attr

Callers 4

handleUidPostingsMethod · 0.85
helpProcessTaskMethod · 0.85
handleHasFunctionMethod · 0.85

Calls 3

StateFunction · 0.92
langForFuncFunction · 0.85
HasLangMethod · 0.80

Tested by

no test coverage detected