Skip to content

Commit

Permalink
search will now return err if analysis fails
Browse files Browse the repository at this point in the history
  • Loading branch information
moshaad7 committed Oct 11, 2023
1 parent e15d283 commit 0dc93ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion search/query/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (q *MatchQuery) Searcher(ctx context.Context, i index.IndexReader, m mappin

tokens, err := analysis.AnalyzeForTokens(analyzer, []byte(q.Match))
if err != nil {
fmt.Printf("(*MatchQuery) Searcher: analysis err:%+v\n", err)
return nil, fmt.Errorf("error analyzing input: %v", err)
}

if len(tokens) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion search/query/match_phrase.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (q *MatchPhraseQuery) Searcher(ctx context.Context, i index.IndexReader, m

tokens, err := analysis.AnalyzeForTokens(analyzer, []byte(q.MatchPhrase))
if err != nil {
fmt.Printf("(*MatchQuery) Searcher: analysis err:%+v\n", err)
return nil, fmt.Errorf("error analyzing input: %v", err)
}
if len(tokens) > 0 {
phrase := tokenStreamToPhrase(tokens)
Expand Down

0 comments on commit 0dc93ee

Please sign in to comment.