(name string)
| 243 | } |
| 244 | |
| 245 | func 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 | |
| 281 | func needsIndex(fnType FuncType, uidList *pb.List) bool { |
| 282 | switch fnType { |
no test coverage detected