on master help sign in
[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>

commit987b0d6f5b238c9b8cb13050d39b24d163335261 authorMarkus Heiser <markus.heiser@darmarit.de> dateSat 4 Sep 2021, 12:41 (5 years ago) parent4db5b97
1 file changed+1−1
searx/engines/xpath.py+1−1
searx/engines/xpath.py+1−1
@@ -48,7 +48,7 @@ def response(resp):
4848 for result in eval_xpath_list(dom, results_xpath):
4949 url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)
5050 title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
51− content = extract_text(eval_xpath_list(result, content_xpath, min_len=1))
51+ content = extract_text(eval_xpath_list(result, content_xpath))
5252 tmp_result = {'url': url, 'title': title, 'content': content}
5353
5454 # add thumbnail if available