Skip to content

Commit

Permalink
remove regex optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
CascadingRadium committed Nov 29, 2024
1 parent f19cedc commit 91be472
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions search/searcher/search_regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ func NewRegexpStringSearcher(ctx context.Context, indexReader index.IndexReader,
if err != nil {
return nil, err
}
// check if the candidateTerms are empty or have one term which is the term itself
if len(candidateTerms) == 0 || (len(candidateTerms) == 1 && candidateTerms[0] == pattern) {
return NewTermSearcher(ctx, indexReader, pattern, field, boost, options)
}

return NewMultiTermSearcher(ctx, indexReader, candidateTerms, field, boost,
options, true)
Expand Down

0 comments on commit 91be472

Please sign in to comment.