Flask /search endpoint backing the frontend.
GET /search?q=<query>&page=1&page_size=10 (page_size capped at 50).
{
"results": [{ "url": "...", "title": "...", "description": "...", "score": 12, "exact_match": false }],
"meta": { "query": "...", "search_speed_ms": 6.1, "total_results": 1 },
"pagination": { "page": 1, "page_size": 10, "total_pages": 1, "has_next": false, "has_previous": false }
}Tokenize query with tkz, look up quickly_word_index, join page metadata, count backlinks, then sort by:
- Exact URL match (pinned to top, tagged
exact_match: true) - Distinct query words in title
- Distinct query words in description
- Distinct query words anywhere
- Keyword score (title/description weighted at index time)
- Backlink count
- Title
Domain-like queries (google.com, https://...) are matched against URL variants with/without www., http/https, and trailing slash.
export DB_URL="postgresql://user:pass@localhost:5432/quickly"
make api # from repo root
# or
uv run flask --app main run # from this dirPermissive CORS is enabled for local dev.