summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-09-04 12:41:23 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2021-09-04 12:41:23 +0200
commit9ff881f9375f451cfa387c3ee6a84844c808a5a2 (patch)
treef5783733a560a7260d1b41eb9cff540cc7b4899d
parent018537080ce6135d41cd0697cef7c73a4ce372ab (diff)
[fix] remove minimum length of content for XPath engine
Instead of raising an exception and therefore hiding all results of the engine. It make sense to remove that requirement in order to allow the implementation of search engines that do not always have a description. In fact some search engines that in 99% of the case have a description like Brave Search or Mojeek crash completely if they for some reason included a result with no description. To test this patch try Mojeek: !mjk xyz before and after the patch. Suggested-by: 0xhtml in https://github.com/searx/searx/discussions/2933 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r--searx/engines/xpath.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
index e14f982b9..0f88fb29a 100644
--- a/searx/engines/xpath.py
+++ b/searx/engines/xpath.py
@@ -194,7 +194,7 @@ def response(resp):
url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)
title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
- content = extract_text(eval_xpath_list(result, content_xpath, min_len=1))
+ content = extract_text(eval_xpath_list(result, content_xpath))
tmp_result = {'url': url, 'title': title, 'content': content}
# add thumbnail if available