summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorPydo <pydo@tutanota.com>2016-10-01 10:46:18 -0400
committerPydo <pydo@tutanota.com>2016-10-01 10:46:18 -0400
commit55a5b686ed6dc0b9a6bfc45e0eaf1f70e24f2aea (patch)
tree96e953057dd3fc29681039f7ac5b282dac189ee8 /searx/webapp.py
parent6f87bf2a1c76f1b94ad2119df7fb938c2307e370 (diff)
parent295fc9ce96d8cca9c6c4776a00e5fb0942eb6f4d (diff)
Merge branch 'master' of https://github.com/asciimoo/searx into feature/seedpeer-engine-integration
Resolved conflict searx/settings.yml
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 800bde004..262bf9bdf 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -395,11 +395,9 @@ def index():
search.paging = True
if search.request_data.get('format', 'html') == 'html':
- if 'content' in result:
- result['content'] = highlight_content(result['content'],
- search.query.encode('utf-8')) # noqa
- result['title'] = highlight_content(result['title'],
- search.query.encode('utf-8'))
+ if 'content' in result and result['content']:
+ result['content'] = highlight_content(result['content'][:1024], search.query.encode('utf-8'))
+ result['title'] = highlight_content(result['title'], search.query.encode('utf-8'))
else:
if result.get('content'):
result['content'] = html_to_text(result['content']).strip()
@@ -559,7 +557,6 @@ def preferences():
lang = request.preferences.get_value('language')
disabled_engines = request.preferences.engines.get_disabled()
allowed_plugins = request.preferences.plugins.get_enabled()
- results_on_new_tab = request.preferences.get_value('results_on_new_tab')
# stats for preferences page
stats = {}
@@ -724,7 +721,7 @@ def config():
@app.errorhandler(404)
def page_not_found(e):
- return render('404.html')
+ return render('404.html'), 404
def run():
@@ -732,7 +729,8 @@ def run():
debug=settings['general']['debug'],
use_debugger=settings['general']['debug'],
port=settings['server']['port'],
- host=settings['server']['bind_address']
+ host=settings['server']['bind_address'],
+ threaded=True
)