Search: use named search type selector.
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
isRegexpflag tosearchType -
extracts the logic in
pattern_type.gothat overrides the searchType based on thepatterntypefield to the the new functiondetectSearchType. This function uses the query parser, not regex patterns, to get the field values ofpatterntype. -
Side effect: separates the
ParseAndCheckfunction, because we needParseto be separately exposed for checkingpatterntype.
Test plan:
- Updates tests and removes tests for
pattern_type.gothat don't make sense with the new structure (checking, e.g.,patterntype).