From 4a36a3044d6e39bc60d026d99ed7a010f6505a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Mon, 30 Nov 2020 08:35:15 +0100 Subject: Add recoll engine (#2325) recoll is a local search engine based on Xapian: http://www.lesbonscomptes.com/recoll/ By itself recoll does not offer web or API access, this can be achieved using recoll-webui: https://framagit.org/medoc92/recollwebui.git This engine uses a custom 'files' result template set `base_url` to the location where recoll-webui can be reached set `dl_prefix` to a location where the file hierarchy as indexed by recoll can be reached set `search_dir` to the part of the indexed file hierarchy to be searched, use an empty string to search the entire search domain --- searx/templates/oscar/result_templates/files.html | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 searx/templates/oscar/result_templates/files.html (limited to 'searx/templates/oscar/result_templates') diff --git a/searx/templates/oscar/result_templates/files.html b/searx/templates/oscar/result_templates/files.html new file mode 100644 index 000000000..5e3894e0a --- /dev/null +++ b/searx/templates/oscar/result_templates/files.html @@ -0,0 +1,55 @@ +{% from 'oscar/macros.html' import result_header, result_sub_header, result_footer_nocache, result_footer_nocache_rtl, icon with context %} + +{{ result_header(result, favicons) }} +{{ result_sub_header(result) }} + +{% if result.embedded %} + +{% endif %} + +{% if result.embedded %} +
+ {{ result.embedded|safe }} +
+{% endif %} + +{% if result.abstract %}

{{ result.abstract|safe }}

{% endif %} + +{% if result.img_src %} +
+
+{{ result.title|striptags }} +{% if result.content %}

{{ result.content|safe }}

{% endif %} +
+
+{% else %} +{% if result.content %}

{{ result.content|safe }}

{% endif %} +{% endif %} + + +{% if result.author %}{% endif %} + +{% if result.filename %}{% endif %} + +{% if result.size %} +{% endif %} + +{% if result.time %}{% endif %} + +{% if result.mtype %}{% endif %} +
{{ _('Author') }}{{ result.author|safe }}
{{ _('Filename') }}{{ result.filename|safe }}
{{ _('Filesize') }} + {% if result.size < 1024 %}{{ result.size }} {{ _('Bytes') }} + {% elif result.size < 1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024) }} {{ _('kiB') }} + {% elif result.size < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024) }} {{ _('MiB') }} + {% elif result.size < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024) }} {{ _('GiB') }} + {% else %}{{ '{0:0.2f}'.format(result.size/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %} +
{{ _('Date') }}{{ result.time|safe }}
{{ _('Type') }}{{ result.mtype|safe }}/{{ result.subtype|safe }}
+ +{% if rtl %} +{{ result_footer_nocache_rtl(result) }} +{% else %} +{{ result_footer_nocache(result) }} +{% endif %} -- cgit v1.2.3