MCPcopy Create free account
hub / github.com/brimdata/super / NewSearchString

Function NewSearchString

runtime/sam/expr/filter.go:157–165  ·  view source on GitHub ↗

NewSearchString is like NewSeach but handles the special case of matching field names in addition to string values.

(term string, expr Evaluator)

Source from the content-addressed store, hash-verified

155// NewSearchString is like NewSeach but handles the special case of matching
156// field names in addition to string values.
157func NewSearchString(term string, expr Evaluator) Evaluator {
158 return &searchString{
159 term: term,
160 expr: expr,
161 fnm: NewFieldNameMatcher(func(b []byte) bool {
162 return StringContainsFold(byteconv.UnsafeString(b), term)
163 }),
164 }
165}
166
167func (s *searchString) Eval(val super.Value) super.Value {
168 if s.expr != nil {

Callers 2

compileSearchMethod · 0.92
CallMethod · 0.92

Calls 3

UnsafeStringFunction · 0.92
NewFieldNameMatcherFunction · 0.85
StringContainsFoldFunction · 0.85

Tested by

no test coverage detected