From a6dd9b9e180247b2a27bdcaba8802c472d36cdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 19 Mar 2026 11:25:42 +0100 Subject: [PATCH] Use the fast vector highlighter for highlighting search results --- services/search/pkg/opensearch/backend.go | 4 +++- services/search/pkg/opensearch/internal/osu/request.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/search/pkg/opensearch/backend.go b/services/search/pkg/opensearch/backend.go index d41121730b..18d0995c2a 100644 --- a/services/search/pkg/opensearch/backend.go +++ b/services/search/pkg/opensearch/backend.go @@ -115,7 +115,9 @@ func (b *Backend) Search(ctx context.Context, sir *searchService.SearchIndexRequ PreTags: []string{""}, PostTags: []string{""}, Fields: map[string]osu.BodyParamHighlight{ - "Content": {}, + "Content": { + Type: "fvh", + }, }, }, }, diff --git a/services/search/pkg/opensearch/internal/osu/request.go b/services/search/pkg/opensearch/internal/osu/request.go index 8e845cf0af..04e4c3396d 100644 --- a/services/search/pkg/opensearch/internal/osu/request.go +++ b/services/search/pkg/opensearch/internal/osu/request.go @@ -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"` }