pub struct ChainEntry {
pub backend: Box<dyn SearchBackend>,
pub prefer_deep: bool,
}Expand description
One backend and the one thing the chain needs to know about it beyond how to call it.
Fields§
§backend: Box<dyn SearchBackend>§prefer_deep: boolMove this backend to the front when the caller asked for Depth::Deep.
Depth used to change only how a backend searched, never which one
ran, so a research question went to whatever was cheapest and first —
and a paid backend chosen precisely for hard questions was reached only
when the free one came up empty. This is the other half: config says
which backends are worth their price on a hard question, and the chain
puts them first for exactly those.
It reorders rather than filters, deliberately. A preferred backend that is rate-limited must still fall through to the free one, and a quick query must still be able to reach the paid backend as a fallback when the free one is down — which is the arrangement that kept working through a total searxng outage.