MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / parseFuncTypeHelper

Function parseFuncTypeHelper

worker/task.go:245–279  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

243}
244
245func parseFuncTypeHelper(name string) (FuncType, string) {
246 if len(name) == 0 {
247 return notAFunction, ""
248 }
249 f := strings.ToLower(name)
250 switch f {
251 case "le", "ge", "lt", "gt", "eq", "between":
252 return compareAttrFn, f
253 case "min", "max", "sum", "avg":
254 return aggregatorFn, f
255 case "checkpwd":
256 return passwordFn, f
257 case "regexp":
258 return regexFn, f
259 case "ngram":
260 return ngramFn, f
261 case "alloftext", "anyoftext":
262 return fullTextSearchFn, f
263 case "has":
264 return hasFn, f
265 case "uid_in":
266 return uidInFn, f
267 case "similar_to":
268 return similarToFn, f
269 case "anyof", "allof":
270 return customIndexFn, f
271 case "match":
272 return matchFn, f
273 default:
274 if types.IsGeoFunc(f) {
275 return geoFn, f
276 }
277 return standardFn, f
278 }
279}
280
281func needsIndex(fnType FuncType, uidList *pb.List) bool {
282 switch fnType {

Callers 2

parseFuncTypeFunction · 0.85
preprocessFilterFunction · 0.85

Calls 1

IsGeoFuncFunction · 0.92

Tested by

no test coverage detected