.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self) | |
extend (self, str|None engine_name, results) | |
close (self) | |
list[MainResult|LegacyResult] | get_ordered_results (self) |
int | number_of_results (self) |
add_unresponsive_engine (self, str engine_name, str error_type, bool suspended=False) | |
add_timing (self, str engine_name, float engine_time, float page_load_time) | |
get_timings (self) | |
Public Attributes | |
answers = AnswerSet() | |
dict[str, dict[str, str]] | engine_data = defaultdict(dict) |
bool | paging = False |
Set[UnresponsiveEngine] | unresponsive_engines = set() |
list | timings = [] |
str|None | redirect_url = None |
bool | on_result = lambda _: True |
Static Public Attributes | |
dict | main_results_map [int, MainResult | LegacyResult] |
list | infoboxes [LegacyResult] |
set | suggestions [str] |
set | corrections [str] |
Protected Member Functions | |
_merge_infobox (self, LegacyResult new_infobox) | |
_merge_main_result (self, MainResult|LegacyResult result, position) | |
Protected Attributes | |
list | _number_of_results = [] |
bool | _closed = False |
_lock = RLock() | |
list[MainResult|LegacyResult] | _main_results_sorted = None |
In the result container, the results are collected, sorted and duplicates will be merged.
Definition at line 50 of file results.py.
searx.results.ResultContainer.__init__ | ( | self | ) |
Definition at line 62 of file results.py.
References infoboxes, main_results_map, and suggestions.
|
protected |
Definition at line 153 of file results.py.
References searx.metrics.models.Histogram._lock, _lock, infoboxes, and searx.results.merge_two_infoboxes().
Referenced by extend().
|
protected |
Definition at line 166 of file results.py.
References searx.metrics.models.Histogram._lock, _lock, main_results_map, and searx.results.merge_two_main_results().
Referenced by extend().
searx.results.ResultContainer.add_timing | ( | self, | |
str | engine_name, | ||
float | engine_time, | ||
float | page_load_time ) |
Definition at line 275 of file results.py.
References _closed, searx.metrics.models.Histogram._lock, _lock, searx.extended_types.SXNG_Request.timings, and timings.
searx.results.ResultContainer.add_unresponsive_engine | ( | self, | |
str | engine_name, | ||
str | error_type, | ||
bool | suspended = False ) |
Definition at line 267 of file results.py.
References _closed, searx.metrics.models.Histogram._lock, _lock, and unresponsive_engines.
searx.results.ResultContainer.close | ( | self | ) |
Definition at line 182 of file results.py.
References _closed, searx.results.calculate_score(), and main_results_map.
Referenced by get_ordered_results().
searx.results.ResultContainer.extend | ( | self, | |
str | None | engine_name, | ||
results ) |
Definition at line 80 of file results.py.
References _closed, _merge_infobox(), _merge_main_result(), _number_of_results, answers, corrections, engine_data, on_result, paging, and suggestions.
list[MainResult | LegacyResult] searx.results.ResultContainer.get_ordered_results | ( | self | ) |
Returns a sorted list of results to be displayed in the main result area (:ref:`result types`).
Definition at line 190 of file results.py.
References _closed, _main_results_sorted, close(), and main_results_map.
Referenced by number_of_results().
searx.results.ResultContainer.get_timings | ( | self | ) |
Definition at line 282 of file results.py.
References _closed, searx.metrics.models.Histogram._lock, _lock, searx.extended_types.SXNG_Request.timings, and timings.
int searx.results.ResultContainer.number_of_results | ( | self | ) |
Returns the average of results number, returns zero if the average result number is smaller than the actual result count.
Definition at line 249 of file results.py.
References _closed, searx.metrics.models.Histogram._lock, _lock, _number_of_results, and get_ordered_results().
|
protected |
Definition at line 71 of file results.py.
Referenced by add_timing(), add_unresponsive_engine(), close(), extend(), get_ordered_results(), get_timings(), and number_of_results().
|
protected |
Definition at line 77 of file results.py.
Referenced by _merge_infobox(), _merge_main_result(), add_timing(), add_unresponsive_engine(), get_timings(), and number_of_results().
|
protected |
Definition at line 78 of file results.py.
Referenced by get_ordered_results().
|
protected |
Definition at line 69 of file results.py.
Referenced by extend(), and number_of_results().
searx.results.ResultContainer.answers = AnswerSet() |
Definition at line 66 of file results.py.
Referenced by extend().
|
static |
Definition at line 60 of file results.py.
Referenced by extend().
dict[str, dict[str, str]] searx.results.ResultContainer.engine_data = defaultdict(dict) |
Definition at line 70 of file results.py.
Referenced by searx.search.models.SearchQuery.__copy__(), and extend().
|
static |
Definition at line 57 of file results.py.
Referenced by __init__(), and _merge_infobox().
|
static |
Definition at line 56 of file results.py.
Referenced by __init__(), _merge_main_result(), close(), and get_ordered_results().
bool searx.results.ResultContainer.on_result = lambda _: True |
Definition at line 76 of file results.py.
Referenced by extend().
bool searx.results.ResultContainer.paging = False |
Definition at line 72 of file results.py.
Referenced by extend().
str | None searx.results.ResultContainer.redirect_url = None |
Definition at line 75 of file results.py.
|
static |
Definition at line 58 of file results.py.
Referenced by __init__(), and extend().
list searx.results.ResultContainer.timings = [] |
Definition at line 74 of file results.py.
Referenced by add_timing(), and get_timings().
Set[UnresponsiveEngine] searx.results.ResultContainer.unresponsive_engines = set() |
Definition at line 73 of file results.py.
Referenced by add_unresponsive_engine().