summaryrefslogtreecommitdiff
path: root/docs/dev
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-03-05 17:29:20 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-03-15 10:36:33 +0100
commit8769b7c6d6d62b961d62b9454bd12f69fba298c8 (patch)
treebdf58284b785169606060acc257db5c1e828b430 /docs/dev
parentd6ce29f7f05a2ff49e1b8566d49b9ca21c30936a (diff)
[refactor] typification of SearXNG (MainResult) / result items (part 2)
The class ReslutContainer has been revised, it can now handle the typed Result items of classes: - MainResult - LegacyResult (a dict wrapper for backward compatibility) Due to the now complete typing of theses three clases, instead of the *getitem* accesses, the fields can now be accessed directly via attributes (which is also supported by the IDE). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/result_types/answer.rst3
-rw-r--r--docs/dev/result_types/correction.rst2
-rw-r--r--docs/dev/result_types/index.rst20
-rw-r--r--docs/dev/result_types/infobox.rst3
-rw-r--r--docs/dev/result_types/main/mainresult.rst4
-rw-r--r--docs/dev/result_types/main_result.rst26
-rw-r--r--docs/dev/result_types/suggestion.rst2
7 files changed, 45 insertions, 15 deletions
diff --git a/docs/dev/result_types/answer.rst b/docs/dev/result_types/answer.rst
index 72368be39..56f36643a 100644
--- a/docs/dev/result_types/answer.rst
+++ b/docs/dev/result_types/answer.rst
@@ -4,4 +4,7 @@
Answer Results
==============
+The :ref:`area answer results` is an area in which additional information can
+be displayed.
+
.. automodule:: searx.result_types.answer
diff --git a/docs/dev/result_types/correction.rst b/docs/dev/result_types/correction.rst
index 51cdd45d2..4f4748644 100644
--- a/docs/dev/result_types/correction.rst
+++ b/docs/dev/result_types/correction.rst
@@ -9,7 +9,7 @@ Correction Results
There is still no typing for these result items. The templates can be used as
orientation until the final typing is complete.
-The corrections area shows the user alternative search terms.
+The :ref:`area corrections results` shows the user alternative search terms.
A result of this type is a very simple dictionary with only one key/value pair
diff --git a/docs/dev/result_types/index.rst b/docs/dev/result_types/index.rst
index e90dba849..3fdc05599 100644
--- a/docs/dev/result_types/index.rst
+++ b/docs/dev/result_types/index.rst
@@ -18,22 +18,32 @@ The **sources** can be:
The sources provide the results, which are displayed in different **areas**
depending on the type of result. The areas are:
-main results:
+.. _area main results:
+
+:ref:`area main results <main search results>`
It is the main area in which -- as is typical for search engines -- the
results that a search engine has found for the search term are displayed.
-answers:
+.. _area answer results:
+
+:ref:`area answers <result_types.answer>`
This area displays short answers that could be found for the search term.
-info box:
+.. _area info box:
+
+:ref:`area info box <result_types.infobox>`
An area in which additional information can be displayed, e.g. excerpts from
wikipedia or other sources such as maps.
-suggestions:
+.. _area suggestions results:
+
+:ref:`area suggestions <result_types.suggestion>`
Suggestions for alternative search terms can be found in this area. These can
be clicked on and a search is carried out with these search terms.
-corrections:
+.. _area corrections results:
+
+:ref:`area corrections <result_types.corrections>`
Results in this area are like the suggestion of alternative search terms,
which usually result from spelling corrections
diff --git a/docs/dev/result_types/infobox.rst b/docs/dev/result_types/infobox.rst
index 428dc8db7..a017015a7 100644
--- a/docs/dev/result_types/infobox.rst
+++ b/docs/dev/result_types/infobox.rst
@@ -9,7 +9,7 @@ Infobox Results
There is still no typing for these result items. The templates can be used as
orientation until the final typing is complete.
-The infobox is an area where addtional infos shown to the user.
+The :ref:`area info box` is an area where addtional infos shown to the user.
Fields used in the :origin:`infobox.html
<searx/templates/simple/elements/infobox.html>`:
@@ -57,4 +57,3 @@ relatedTopics: :py:class:`List <list>`\ [\ :py:class:`dict`\ ]
key/value pair:
- suggestion: :py:class:`str`: suggested search term (mandatory)
-
diff --git a/docs/dev/result_types/main/mainresult.rst b/docs/dev/result_types/main/mainresult.rst
new file mode 100644
index 000000000..dc5d3f005
--- /dev/null
+++ b/docs/dev/result_types/main/mainresult.rst
@@ -0,0 +1,4 @@
+.. _result_types.mainresult:
+
+.. autoclass:: searx.result_types._base.MainResult
+ :members:
diff --git a/docs/dev/result_types/main_result.rst b/docs/dev/result_types/main_result.rst
index 1f178cbd1..0c9ca619e 100644
--- a/docs/dev/result_types/main_result.rst
+++ b/docs/dev/result_types/main_result.rst
@@ -1,11 +1,25 @@
-============
-Main Results
-============
+.. _main search results:
-There is still no typing for the items in the :ref:`main result list`. The
-templates can be used as orientation until the final typing is complete.
+===================
+Main Search Results
+===================
-- :ref:`template default`
+In the :ref:`area main results` the results that a search engine has found for
+the search term are displayed.
+
+There is still no typing for all items in the :ref:`main result list`. The
+following types have been implemented so far ..
+
+.. toctree::
+ :maxdepth: 2
+
+ main/mainresult
+
+The :ref:`LegacyResult <LegacyResult>` is used internally for the results that
+have not yet been typed. The templates can be used as orientation until the
+final typing is complete.
+
+- :ref:`template default` / :py:obj:`Result`
- :ref:`template images`
- :ref:`template videos`
- :ref:`template torrent`
diff --git a/docs/dev/result_types/suggestion.rst b/docs/dev/result_types/suggestion.rst
index 52e8a05a8..b318894b7 100644
--- a/docs/dev/result_types/suggestion.rst
+++ b/docs/dev/result_types/suggestion.rst
@@ -9,7 +9,7 @@ Suggestion Results
There is still no typing for these result items. The templates can be used as
orientation until the final typing is complete.
-The suggestions area shows the user alternative search terms.
+The :ref:`area suggestions results` shows the user alternative search terms.
A result of this type is a very simple dictionary with only one key/value pair