Revert "Strengthen search breadth and modal fitting"

This reverts commit 5ca7aef3f1.
This commit is contained in:
AI Assistant
2026-03-17 13:20:44 +09:00
parent 5ca7aef3f1
commit 3f824c4bdf
10 changed files with 49 additions and 110 deletions
+4 -4
View File
@@ -94,9 +94,9 @@ func (s *SearchService) SearchMediaWithDeadline(queries []string, enabledPlatfor
results := make([]SearchResult, 0, 90)
var lastErr error
baseQueries := limitQueries(queries, 10)
baseQueries := limitQueries(queries, 8)
shuffleStrings(baseQueries)
primaryQueries := baseQueries[:minInt(len(baseQueries), 4)]
primaryQueries := baseQueries[:minInt(len(baseQueries), 3)]
runSearchPass := func(bases []string, onlyMissing bool) {
for _, base := range bases {
if !deadline.IsZero() && time.Now().After(deadline) {
@@ -1432,9 +1432,9 @@ func limitCollectorQueries(collector string, queries []string, onlyMissing bool)
limit := 2
switch collector {
case "Envato", "Artgrid":
limit = 5
case "Google Video":
limit = 4
case "Google Video":
limit = 3
}
if onlyMissing {
limit--
+4 -4
View File
@@ -159,13 +159,13 @@ func TestLimitCollectorQueriesUsesSmallerBudgetForMissingPass(t *testing.T) {
queries := []string{"a", "b", "c", "d"}
got := limitCollectorQueries("Artgrid", queries, true)
if len(got) != 4 {
t.Fatalf("expected 4 queries for missing-pass Artgrid collector, got %d", len(got))
if len(got) != 3 {
t.Fatalf("expected 3 queries for missing-pass Artgrid collector, got %d", len(got))
}
got = limitCollectorQueries("Google Video", queries, false)
if len(got) != 4 {
t.Fatalf("expected 4 queries for Google Video collector, got %d", len(got))
if len(got) != 3 {
t.Fatalf("expected 3 queries for Google Video collector, got %d", len(got))
}
}
+2 -2
View File
@@ -123,8 +123,8 @@ func TestRemainingGeminiCapacityShrinksWithReviewedItems(t *testing.T) {
{Link: "https://a.example"},
{Link: "https://b.example"},
}
if got := RemainingGeminiCapacity(reviewed); got != 22 {
t.Fatalf("expected 22 remaining slots, got %d", got)
if got := RemainingGeminiCapacity(reviewed); got != 14 {
t.Fatalf("expected 14 remaining slots, got %d", got)
}
}
+2 -2
View File
@@ -97,7 +97,7 @@ func RankSearchResults(query string, results []SearchResult) []SearchResult {
}
func GeminiCandidateLimit(total int) int {
return min(total, 24)
return min(total, 16)
}
func EvaluateAllCandidatesWithGemini(service *GeminiService, query string, ranked []SearchResult) ([]AIRecommendation, GeminiBatchStats, error) {
@@ -291,7 +291,7 @@ func ReviewedRecommendationLinks(items []AIRecommendation) map[string]bool {
}
func RemainingGeminiCapacity(reviewed []AIRecommendation) int {
remaining := GeminiCandidateLimit(24) - len(ReviewedRecommendationLinks(reviewed))
remaining := GeminiCandidateLimit(16) - len(ReviewedRecommendationLinks(reviewed))
if remaining < 0 {
return 0
}
+3 -3
View File
@@ -15,7 +15,7 @@ type searchCollector interface {
type envatoCollector struct{}
func (envatoCollector) Name() string { return "Envato" }
func (envatoCollector) MaxResults() int { return 16 }
func (envatoCollector) MaxResults() int { return 12 }
func (envatoCollector) Enabled(enabledPlatforms map[string]bool) bool {
return len(enabledPlatforms) == 0 || enabledPlatforms["envato"]
}
@@ -31,7 +31,7 @@ func (envatoCollector) Enrich(searcher *SearchService, result SearchResult) Sear
type artgridCollector struct{}
func (artgridCollector) Name() string { return "Artgrid" }
func (artgridCollector) MaxResults() int { return 16 }
func (artgridCollector) MaxResults() int { return 12 }
func (artgridCollector) Enabled(enabledPlatforms map[string]bool) bool {
return len(enabledPlatforms) == 0 || enabledPlatforms["artgrid"]
}
@@ -47,7 +47,7 @@ func (artgridCollector) Enrich(searcher *SearchService, result SearchResult) Sea
type googleVideoCollector struct{}
func (googleVideoCollector) Name() string { return "Google Video" }
func (googleVideoCollector) MaxResults() int { return 12 }
func (googleVideoCollector) MaxResults() int { return 8 }
func (googleVideoCollector) Enabled(enabledPlatforms map[string]bool) bool {
return len(enabledPlatforms) == 0 || enabledPlatforms["google video"]
}