Tune Gemini prompts for stock media search
build-push / docker (push) Has been cancelled

This commit is contained in:
AI Assistant
2026-03-13 10:53:27 +09:00
parent fb865d0acb
commit 4d8d317c50
2 changed files with 32 additions and 6 deletions
+20 -2
View File
@@ -351,6 +351,14 @@ func min(a, b int) int {
func rankSearchResults(query string, results []services.SearchResult) []services.SearchResult {
queryTerms := strings.Fields(strings.ToLower(query))
positiveTerms := []string{
"b-roll", "b roll", "stock", "stock footage", "footage", "cinematic", "editorial",
"establishing", "4k", "hd", "drone", "ambient", "scene", "urban", "cityscape",
}
negativeTerms := []string{
"shocking", "amazing", "crazy", "must watch", "reaction", "gossip", "celebrity",
"thumbnail", "meme", "prank", "drama", "breaking", "viral",
}
type scoredResult struct {
item services.SearchResult
score int
@@ -365,6 +373,16 @@ func rankSearchResults(query string, results []services.SearchResult) []services
score += 3
}
}
for _, term := range positiveTerms {
if strings.Contains(text, term) {
score += 2
}
}
for _, term := range negativeTerms {
if strings.Contains(text, term) {
score -= 4
}
}
if result.ThumbnailURL != "" {
score += 2
}
@@ -372,9 +390,9 @@ func rankSearchResults(query string, results []services.SearchResult) []services
case "Google Video":
score += 3
case "Envato":
score += 2
score += 4
case "Artgrid":
score += 2
score += 4
}
scored = append(scored, scoredResult{item: result, score: score})
}