feat: 添加 Meilisearch 排名分数支持

This commit is contained in:
2026-04-09 13:58:36 +08:00
parent 5022e9115d
commit 8eb992e658
2 changed files with 3 additions and 0 deletions

View File

@@ -226,6 +226,8 @@ func (m *meilisearchDB) buildSearchRequest(ctx context.Context, searchParams *Se
req.AttributesToRetrieve = searchParams.AttributesToRetrieve req.AttributesToRetrieve = searchParams.AttributesToRetrieve
} }
req.ShowRankingScore = searchParams.ShowRankingScore
return req, nil return req, nil
} }

View File

@@ -15,6 +15,7 @@ type SearchParams struct {
AttributesToRetrieve []string // 返回字段 AttributesToRetrieve []string // 返回字段
Facets []string // 聚合字段 Facets []string // 聚合字段
HitsPerPage int // 每页命中数 HitsPerPage int // 每页命中数
ShowRankingScore bool // 是否显示排名分数
} }
// SearchResult 搜索结果 // SearchResult 搜索结果