Add platform-specific query optimizations

- hackernews: use extract_core_subject instead of raw topic, add
  points>5 filter and restrictSearchableAttributes=title to reduce
  noise from URL-match and low-signal posts
- youtube: add --dateafter parameter to yt-dlp for server-side date
  filtering (Python soft filter still handles fallback)
- reddit: skip opinion/review query variant for how_to/comparison
  queries where it adds noise
- bird_x: add OR-group retry with compound terms before falling back
  to word-dropping (uses X OR operator for multi-concept queries)
- query.py: add detect_query_type() and extract_compound_terms()
This commit is contained in:
Jeffrey Sperling
2026-03-11 15:24:44 -07:00
parent c5be117701
commit 1002f1f020
6 changed files with 140 additions and 11 deletions
+4 -2
View File
@@ -48,7 +48,7 @@ DEPTH_CONFIG = {
},
}
from .query import extract_core_subject as _query_extract
from .query import detect_query_type, extract_core_subject as _query_extract
from .relevance import token_overlap_relevance
# Reddit-specific noise words (preserves original smaller set)
@@ -107,7 +107,9 @@ def expand_reddit_queries(topic: str, depth: str) -> List[str]:
if core.lower() != original_clean.lower() and len(original_clean.split()) <= 8:
queries.append(original_clean)
if depth in ("default", "deep"):
# Add opinion/review variant except for how_to/comparison queries
qtype = detect_query_type(topic)
if depth in ("default", "deep") and qtype not in ("how_to", "comparison"):
queries.append(f"{core} worth it OR thoughts OR review")
if depth == "deep":