mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
[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>
This commit is contained in:
parent
d6ce29f7f0
commit
8769b7c6d6
15 changed files with 608 additions and 541 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
4
docs/dev/result_types/main/mainresult.rst
Normal file
4
docs/dev/result_types/main/mainresult.rst
Normal file
|
@ -0,0 +1,4 @@
|
|||
.. _result_types.mainresult:
|
||||
|
||||
.. autoclass:: searx.result_types._base.MainResult
|
||||
:members:
|
|
@ -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`
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue