on master help sign in
[enh] extend json response with suggestions, infoboxes and answers
commita764ebb4b1025e017c2e10bc9b93066cfcfffcda authorAdam Tauber <asciimoo@gmail.com> dateSat 10 Dec 2016, 21:38 (10 years ago) parentc3dcebb
1 file changed+4−1
searx/webapp.py+4−1
searx/webapp.py+4−1
@@ -470,7 +470,10 @@ def index():
470470 if output_format == 'json':
471471 return Response(json.dumps({'query': search_query.query,
472472 'number_of_results': number_of_results,
473− 'results': results}),
473+ 'results': results,
474+ 'answers': list(result_container.answers),
475+ 'infoboxes': result_container.infoboxes,
476+ 'suggestions': list(result_container.suggestions)}),
474477 mimetype='application/json')
475478 elif output_format == 'csv':
476479 csv = UnicodeWriter(cStringIO.StringIO())