diff options
Diffstat (limited to 'searx/results.py')
-rw-r--r-- | searx/results.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/searx/results.py b/searx/results.py index 1ac6a5ab5..ab242b838 100644 --- a/searx/results.py +++ b/searx/results.py @@ -278,12 +278,18 @@ class ResultContainer: result['parsed_url'] = result['parsed_url']._replace(scheme="http") result['url'] = result['parsed_url'].geturl() + # avoid duplicate content between the content and title fields + if result.get('content') == result.get('title'): + del result['content'] + + # make sure there is a template + if 'template' not in result: + result['template'] = 'default.html' + # strip multiple spaces and cariage returns from content if result.get('content'): result['content'] = WHITESPACE_REGEX.sub(' ', result['content']) - return True - def __merge_url_result(self, result, position): result['engines'] = set([result['engine']]) with self._lock: |