-
Notifications
You must be signed in to change notification settings - Fork 2
primitives
Magnus Hedemark edited this page Jun 10, 2026
·
1 revision
SlopSearX is built on a small set of foundational data types that appear throughout the codebase. These primitives define how search results are represented, how engines communicate status, and how the system is configured.
The three core primitives are:
-
SearchResult (
slopsearx/adapter.py) — the internal normalized result dataclass. Contains url, title, content, engine metadata, score, position, category, and optional date/thumbnail/image fields. Decoupled from any output format. -
AdapterResponse (
slopsearx/adapter.py) — the canonical return type for every adapter'ssearch()method. Wraps a list of SearchResult with a status enum, optional error message, and measured latency. Adapters never raise exceptions. -
EngineStatus (
slopsearx/adapter.py) — an enum with five values: OK, RATE_LIMITED, BLOCKED, ERROR, and TIMEOUT. Every adapter classifies its results using this enum.
Supporting primitives include:
-
EngineEntry (
slopsearx/config.py) — per-engine configuration dataclass. Contains settings for base_url, type, timeout, max_results, rate_limit, weight, api_key, category overrides, and scrape-specific fields. -
Config (
slopsearx/config.py) — top-level configuration that aggregates per-engine entries with global settings for caching, ranking, default engines, and log level.
A search query flows through these primitives in sequence:
- Configuration defines which engines to use and their parameters (via
EngineEntryandConfiginslopsearx/config.py) - Each engine's
search()method returns anAdapterResponsecontaining a list ofSearchResultand anEngineStatus - The merger ranks and deduplicates results, producing a single ranked list of
SearchResult - Formatters serialize
SearchResultlists into the wire format (JSON or YAML+Markdown)
- Search result types — detailed reference for SearchResult, AdapterResponse, EngineStatus, and EngineEntry
- Features overview — how primitives enable engine implementations and output formatters
- System architecture — end-to-end request flow