forked from zaclys/searxng
[enh] extend json response with suggestions, infoboxes and answers
This commit is contained in:
parent
c3dcebb778
commit
a764ebb4b1
|
@ -470,7 +470,10 @@ def index():
|
||||||
if output_format == 'json':
|
if output_format == 'json':
|
||||||
return Response(json.dumps({'query': search_query.query,
|
return Response(json.dumps({'query': search_query.query,
|
||||||
'number_of_results': number_of_results,
|
'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')
|
mimetype='application/json')
|
||||||
elif output_format == 'csv':
|
elif output_format == 'csv':
|
||||||
csv = UnicodeWriter(cStringIO.StringIO())
|
csv = UnicodeWriter(cStringIO.StringIO())
|
||||||
|
|
Loading…
Reference in New Issue