Browse Source

[enh] extend json response with suggestions, infoboxes and answers

Adam Tauber 8 years ago
parent
commit
a764ebb4b1
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      searx/webapp.py

+ 4
- 1
searx/webapp.py View File

@@ -470,7 +470,10 @@ def index():
470 470
     if output_format == 'json':
471 471
         return Response(json.dumps({'query': search_query.query,
472 472
                                     '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)}),
474 477
                         mimetype='application/json')
475 478
     elif output_format == 'csv':
476 479
         csv = UnicodeWriter(cStringIO.StringIO())