From a764ebb4b1025e017c2e10bc9b93066cfcfffcda Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 10 Dec 2016 21:38:34 +0100 Subject: [PATCH] [enh] extend json response with suggestions, infoboxes and answers --- searx/webapp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/searx/webapp.py b/searx/webapp.py index 7d4936f18..096e1f269 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -470,7 +470,10 @@ def index(): if output_format == 'json': return Response(json.dumps({'query': search_query.query, 'number_of_results': number_of_results, - 'results': results}), + 'results': results, + 'answers': list(result_container.answers), + 'infoboxes': result_container.infoboxes, + 'suggestions': list(result_container.suggestions)}), mimetype='application/json') elif output_format == 'csv': csv = UnicodeWriter(cStringIO.StringIO())