Result

Basic types for the typification of results.


class searx.result_types._base.Result(*, url: str | None = None, template: str = 'default.html', engine: str | None = '', parsed_url: ParseResult | None = None)[source]

Base class of all result types Result Types.

url: str | None

A link related to this result

template: str

Name of the template used to render the result.

By default result_templates/default.html is used.

engine: str | None

Name of the engine this result comes from. In case of plugins a prefix plugin: is set, in case of answerer prefix answerer: is set.

The field is optional and is initialized from the context if necessary.

parsed_url: ParseResult | None

urllib.parse.ParseResult of Result.url.

The field is optional and is initialized from the context if necessary.

normalize_result_fields()[source]

Normalize a result ..

  • if field url is set and field parse_url is unset, init parse_url from field url. This method can be extended in the inheritance.

class searx.result_types._base.LegacyResult(*args, **kwargs)[source]

A wrapper around a legacy result item. The SearXNG core uses this class for untyped dictionaries / to be downward compatible.

This class is needed until we have implemented an Result class for each result type and the old usages in the codebase have been fully migrated.

There is only one place where this class is used, in the searx.results.ResultContainer.

Attention

Do not use this class in your own implementations!