Skip to main content

Module search

Module search 

Source
Expand description

GET /api/v2/search/?q= — one search box, every content type.

Each list endpoint has its own ?search=, so a site-wide search used to be four parallel requests the client merged and ranked itself — with nothing in the responses to rank by, since none of them carries a score. That is a lot of work to hand a frontend for the most ordinary feature a site has.

This runs the same per-type searches server-side and returns one ordered list of typed hits. Pages go through the real page search (crate::search), so a configured Postgres FTS or Elasticsearch backend applies — and so do editorial search promotions, which were previously invisible to any API client.

Results are viewer-aware: gated pages and assets in closed collections are dropped before ranking, so search cannot be used to enumerate what the caller may not read.

Structs§

SearchQuery

Functions§

score
How well haystack answers needle, in 0.0..=1.0.
search
GET /api/v2/search/
search_inner