Replies: 3 comments
-
🤔 can't say I often missed an option for key/value pairs in the content .. but often I have seen lists when implementing a result of an engine.
What about a third alternative: in the rendering ( Meanwhile we have typed results for the main result list. For most templates we have not yet implemented a type (class), but at least for the In its current state MainResult.content has to be a string .. we can patch the content property to accept The data structure of the content above would be a content = [
"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
["first list item", "second list item"],
{"foo": "value of foo", "bar": "value of bar"},
]@dalf does this fit to what you have in mind? |
Beta Was this translation helpful? Give feedback.
-
Yes this
I think about something like this WhateverClassResult(
content = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
properties= {"foo": "value of foo", "bar": "value of bar"}, # of keyvalues
)so there is no need to deal with a complex value for content: it is remains a string nothing more. |
Beta Was this translation helpful? Give feedback.
-
|
I've updated my original message to list the various engines that concat multiple fields for the content. Common fieldsHere some common fields that can be extracted from all these concated contents Programming language
Tag list and category list
License
Engagement metrics
Published date, most of the time not parsable
Location
Fields seen once, not repeated elsewhereSpecific to one engine but it make sense for the whole SearXNG category:
From that some suggestions (this require more thinking, just a draft) :
This is quiet different from allowing random key/value, but I think it would make the results more readable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Various engines don't have a proper content, but rather a list of key / value;
The content ends up to be something like this :
' | '.join(content)Would it make sense to:
default.htmltemplate to allow key / valuedefault.htmlto replace the content by a list of key / value.Engines:
searxng/searx/engines/brave.py
Lines 329 to 335 in 3033061
searxng/searx/engines/chefkoch.py
Lines 49 to 53 in 3033061
searxng/searx/engines/deezer.py
Line 53 in 3033061
searxng/searx/engines/fdroid.py
Lines 45 to 49 in 3033061
searxng/searx/engines/geizhals.py
Lines 72 to 74 in 3033061
searxng/searx/engines/gitea.py
Line 96 in 3033061
searxng/searx/engines/github.py
Line 39 in 3033061
searxng/searx/engines/google_news.py
Lines 157 to 162 in 3033061
searxng/searx/engines/huggingface.py
Lines 98 to 106 in 3033061
searxng/searx/engines/imdb.py
Lines 65 to 71 in 3033061
searxng/searx/engines/livespace.py
Lines 65 to 67 in 3033061
searxng/searx/engines/loc.py
Lines 74 to 79 in 3033061
searxng/searx/engines/material_icons.py
Line 57 in 3033061
searxng/searx/engines/moviepilot.py
Line 110 in 3033061
searxng/searx/engines/mrs.py
Lines 62 to 65 in 3033061
searxng/searx/engines/nyaa.py
Lines 103 to 105 in 3033061
searxng/searx/engines/pdbe.py
Lines 104 to 106 in 3033061
searxng/searx/engines/public_domain_image_archive.py
Lines 127 to 134 in 3033061
searxng/searx/engines/qwant.py
Lines 288 to 294 in 3033061
searxng/searx/engines/radio_browser.py
Lines 104 to 112 in 3033061
searxng/searx/engines/rottentomatoes.py
Lines 42 to 48 in 3033061
searxng/searx/engines/rumble.py
Lines 69 to 72 in 3033061
searxng/searx/engines/senscritique.py
Lines 114 to 144 in b61ef7a
searxng/searx/engines/soundcloud.py
Lines 82 to 85 in 3033061
searxng/searx/engines/spotify.py
Line 64 in 3033061
searxng/searx/engines/stackexchange.py
Lines 56 to 60 in 3033061
searxng/searx/engines/steam.py
Line 40 in 3033061
searxng/searx/engines/voidlinux.py
Line 68 in 3033061
searxng/searx/engines/yandex_music.py
Line 58 in 3033061
I most probably miss some other engines.[EDIT] message edited to add the engines concat multiple fields in the content
Beta Was this translation helpful? Give feedback.
All reactions