Use the fast vector highlighter for highlighting search results

This commit is contained in:
André Duffeck
2026-03-19 11:25:42 +01:00
parent 9e93f29ffe
commit a6dd9b9e18
2 changed files with 4 additions and 1 deletions

View File

@@ -115,7 +115,9 @@ func (b *Backend) Search(ctx context.Context, sir *searchService.SearchIndexRequ
PreTags: []string{"<mark>"},
PostTags: []string{"</mark>"},
Fields: map[string]osu.BodyParamHighlight{
"Content": {},
"Content": {
Type: "fvh",
},
},
},
},

View File

@@ -43,6 +43,7 @@ func (q QueryReqBody[O]) MarshalJSON() ([]byte, error) {
type BodyParamHighlight struct {
PreTags []string `json:"pre_tags,omitempty"`
PostTags []string `json:"post_tags,omitempty"`
Type string `json:"type,omitempty"`
Fields map[string]BodyParamHighlight `json:"fields,omitempty"`
}