From 91be4720983269c6ca81955a65403c711c8df90c Mon Sep 17 00:00:00 2001 From: CascadingRadium Date: Fri, 29 Nov 2024 15:33:34 +0530 Subject: [PATCH] remove regex optimization --- search/searcher/search_regexp.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/search/searcher/search_regexp.go b/search/searcher/search_regexp.go index 74caf0703..b88133e31 100644 --- a/search/searcher/search_regexp.go +++ b/search/searcher/search_regexp.go @@ -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)