Search: use named search type selector.
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: rvantonder
We should use a string type instead of a boolean flag to indicate the search kind (whether regex, literal, or soon, structural). This PR:
converts the isRegexp
flag to searchType
extracts the logic in pattern_type.go
that overrides the searchType based on the patterntype
field to the the new function detectSearchType
. This function uses the query parser, not regex patterns, to get the field values of patterntype
.
Side effect: separates the ParseAndCheck
function, because we need Parse
to be separately exposed for checking patterntype
.
Test plan:
pattern_type.go
that don't make sense with the new structure (checking, e.g., patterntype
).
Push commits to the source branch or add previously merged commits to review them.