From a235c54f8c8442242fe727908162e5ece8739b5a Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 28 Jan 2025 20:30:07 +0100 Subject: [mod] rudimentary implementation of a MainResult type Signed-off-by: Markus Heiser --- searx/result_types/_base.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'searx/result_types') diff --git a/searx/result_types/_base.py b/searx/result_types/_base.py index 66e31c7f2..1496cbd2c 100644 --- a/searx/result_types/_base.py +++ b/searx/result_types/_base.py @@ -114,6 +114,25 @@ class Result(msgspec.Struct, kw_only=True): return {f: getattr(self, f) for f in self.__struct_fields__} +class MainResult(Result): # pylint: disable=missing-class-docstring + + # open_group and close_group should not manged in the Result class (we should rop it from here!) + open_group: bool = False + close_group: bool = False + + title: str = "" + """Link title of the result item.""" + + content: str = "" + """Extract or description of the result item""" + + img_src: str = "" + """URL of a image that is displayed in the result item.""" + + thumbnail: str = "" + """URL of a thumbnail that is displayed in the result item.""" + + class LegacyResult(dict): """A wrapper around a legacy result item. The SearXNG core uses this class for untyped dictionaries / to be downward compatible. -- cgit v1.2.3