diff options
author | Alan Pearce | 2024-05-09 18:58:14 +0200 |
---|---|---|
committer | Alan Pearce | 2024-05-09 19:28:15 +0200 |
commit | 3b379a13710cae2adc56131af1069e6fb92976b8 (patch) | |
tree | d7801226ac84e201c6eea11a04941b1137adc78f /internal/search | |
parent | 0986e8699e87addccbef43c0ce30a466988fed15 (diff) | |
download | searchix-3b379a13710cae2adc56131af1069e6fb92976b8.tar.lz searchix-3b379a13710cae2adc56131af1069e6fb92976b8.tar.zst searchix-3b379a13710cae2adc56131af1069e6fb92976b8.zip |
style: reformat with golines and enforce on commit
Diffstat (limited to 'internal/search')
-rw-r--r-- | internal/search/search.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/internal/search/search.go b/internal/search/search.go index 9766294..bc77cea 100644 --- a/internal/search/search.go +++ b/internal/search/search.go @@ -50,14 +50,23 @@ func (index *ReadIndex) GetSource(ctx context.Context, name string) (*bleve.Sear return nil, ctx.Err() default: if err != nil { - return nil, errors.WithMessagef(err, "failed to execute search to find source %s in index", name) + return nil, errors.WithMessagef( + err, + "failed to execute search to find source %s in index", + name, + ) } } return result, nil } -func (index *ReadIndex) Search(ctx context.Context, source string, keyword string, from uint64) (*Result, error) { +func (index *ReadIndex) Search( + ctx context.Context, + source string, + keyword string, + from uint64, +) (*Result, error) { sourceQuery := bleve.NewTermQuery(source) userQuery := bleve.NewMatchQuery(keyword) userQuery.Analyzer = "option_name" |