Skip to content

05 Metasearch and SearXNG

Anurag Prasad edited this page Nov 29, 2026 · 1 revision

5. Metasearch & SearXNG

A metasearch engine owns no index. It forwards a query to several upstream engines, normalises and merges what comes back. This is the component at the centre of the project's collector.

5.1 What SearXNG is

SearXNG (source) is an open-source metasearch engine. It aggregates results from many search services and exposes a common interface, including a JSON search API. Engines are enabled and configured through settings.

sequenceDiagram
    participant C as Collector (runner)
    participant S as SearXNG (service container)
    participant D as DuckDuckGo (upstream)
    C->>S: GET /search?q=...&pageno=n&format=json
    S->>D: engine request (region, page)
    alt normal
        D-->>S: results
        S-->>C: HTTP 200 + results + engine metadata
    else CAPTCHA / throttle
        D-->>S: challenge
        S-->>C: HTTP 200 + zero results + unresponsive_engines
    end
Loading

5.2 Why it fits this lab

Benefit Detail
One endpoint Collector code does not change per engine
Common response shape Normalisation and provenance fields are uniform
Configurable engines Experiments can pin DuckDuckGo-only to keep attribution clean
Central diagnostics Engine errors appear in response metadata and container logs
Ephemeral Starts as a service container inside a GitHub Actions job

5.3 What it does not do

  • It is not a bypass. It abstracts providers; it does not remove upstream restrictions, guarantee depth, or make results available indefinitely.
  • Page size is not fixed: the run saw 10 records on page 1 and ~15 afterwards, despite an expectation of 10 — measure, don't assume.
  • It reports engine failure inside an HTTP 200 body, so clients must parse diagnostics (13).

5.4 Merge and scoring intuition

SearXNG weights results by engine and position and merges duplicate URLs, comparable to rank-fusion ideas in 4.5. Treat its ranking as an aggregate of upstream rankings, not an independent relevance judgement. (Exact scoring: see the SearXNG docs.)

5.5 Alternatives in the same family

Hosted aggregators and agent-oriented APIs are compared in 9. Search APIs for Agents.


❓ Check your understanding

Q1. Why pin SearXNG to one upstream engine in experiments?

To make provenance unambiguous and to avoid silent fallback that would hide an upstream failure. The production path is "SearXNG-only; no silent switch".

Q2. How did the collector detect the page-16 failure?

The endpoint returned HTTP 200 with zero results, while engine diagnostics listed DuckDuckGo/CAPTCHA as unresponsive and the container log showed a CAPTCHA exception.

Q3. If metasearch uses the same upstream as everyone else, where does diversity come from?

Only from enabling multiple independent upstreams — each of which has its own terms, quotas and reliability, to be tested first (Stage 4 in 21).

← Prev 4. Ranking Math · Next → 6. Parametric vs Retrieved Knowledge

Clone this wiki locally