[enh] add quick answer functionality with an example answerer

This commit is contained in:
Adam Tauber 2016-11-19 20:53:51 +01:00
parent 55dc538398
commit 971ed0abd1
7 changed files with 156 additions and 4 deletions

View file

@ -24,6 +24,7 @@ import searx.poolrequests as requests_lib
from searx.engines import (
categories, engines
)
from searx.answerers import ask
from searx.utils import gen_useragent
from searx.query import RawTextQuery, SearchQuery
from searx.results import ResultContainer
@ -254,6 +255,13 @@ class Search(object):
def search(self):
global number_of_searches
answerers_results = ask(self.search_query)
if answerers_results:
for results in answerers_results:
self.result_container.extend('answer', results)
return self.result_container
# init vars
requests = []