This commit is contained in:
@@ -50,6 +50,20 @@
|
|||||||
- Improved result rendering:
|
- Improved result rendering:
|
||||||
- search cards now show source snippet/description separately from AI reason to reduce confusion between asset metadata and Gemini commentary
|
- search cards now show source snippet/description separately from AI reason to reduce confusion between asset metadata and Gemini commentary
|
||||||
|
|
||||||
|
## Current Session Update (2026-03-13, Regression Fix)
|
||||||
|
- A regression was found after search optimization:
|
||||||
|
- Envato and Artgrid disappeared entirely for some real searches while Google Video still returned results
|
||||||
|
- Root cause:
|
||||||
|
- the first optimization reduced query-variant breadth too aggressively
|
||||||
|
- the first 3 query variants were not enough to recover Envato/Artgrid in some real SearXNG result sets
|
||||||
|
- Fix applied:
|
||||||
|
- search now runs in two stages
|
||||||
|
- stage 1 searches only the first few variants for speed
|
||||||
|
- stage 2 searches additional variants only for sources that still returned zero results
|
||||||
|
- Intent:
|
||||||
|
- keep the anti-timeout optimization
|
||||||
|
- recover Envato/Artgrid recall when the early pass is too narrow
|
||||||
|
|
||||||
## Local Self-Test Workflow
|
## Local Self-Test Workflow
|
||||||
- Primary command:
|
- Primary command:
|
||||||
- `bash scripts/selftest.sh`
|
- `bash scripts/selftest.sh`
|
||||||
|
|||||||
+13
-2
@@ -92,8 +92,10 @@ func (s *SearchService) SearchMedia(queries []string, enabledPlatforms map[strin
|
|||||||
results := make([]SearchResult, 0, 90)
|
results := make([]SearchResult, 0, 90)
|
||||||
var lastErr error
|
var lastErr error
|
||||||
|
|
||||||
baseQueries := limitQueries(queries, 3)
|
baseQueries := limitQueries(queries, 6)
|
||||||
for _, base := range baseQueries {
|
primaryQueries := baseQueries[:minInt(len(baseQueries), 3)]
|
||||||
|
runSearchPass := func(bases []string, onlyMissing bool) {
|
||||||
|
for _, base := range bases {
|
||||||
base = strings.TrimSpace(base)
|
base = strings.TrimSpace(base)
|
||||||
if base == "" {
|
if base == "" {
|
||||||
continue
|
continue
|
||||||
@@ -105,6 +107,9 @@ func (s *SearchService) SearchMedia(queries []string, enabledPlatforms map[strin
|
|||||||
if sourceCounts[source.name] >= source.maxResults {
|
if sourceCounts[source.name] >= source.maxResults {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if onlyMissing && sourceCounts[source.name] > 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
for _, searchQuery := range source.build(base) {
|
for _, searchQuery := range source.build(base) {
|
||||||
if sourceCounts[source.name] >= source.maxResults {
|
if sourceCounts[source.name] >= source.maxResults {
|
||||||
break
|
break
|
||||||
@@ -132,6 +137,12 @@ func (s *SearchService) SearchMedia(queries []string, enabledPlatforms map[strin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
runSearchPass(primaryQueries, false)
|
||||||
|
if len(baseQueries) > len(primaryQueries) {
|
||||||
|
runSearchPass(baseQueries[len(primaryQueries):], true)
|
||||||
|
}
|
||||||
|
|
||||||
if len(results) == 0 && lastErr != nil {
|
if len(results) == 0 && lastErr != nil {
|
||||||
return nil, lastErr
|
return nil, lastErr
|
||||||
|
|||||||
Reference in New Issue
Block a user