diff options
author | Adam Tauber <asciimoo@gmail.com> | 2016-11-19 20:53:51 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2016-11-19 20:53:51 +0100 |
commit | 971ed0abd159625bd01d0b3ca52c90b394711d77 (patch) | |
tree | 952a32dea19318981f959f073a68e731c6c017ea /searx/search.py | |
parent | 55dc538398090e437c5e495dddad983a7870d09b (diff) | |
download | searxng-971ed0abd159625bd01d0b3ca52c90b394711d77.tar.gz searxng-971ed0abd159625bd01d0b3ca52c90b394711d77.zip |
[enh] add quick answer functionality with an example answerer
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/search.py b/searx/search.py index c3f1566a9..0095de821 100644 --- a/searx/search.py +++ b/searx/search.py @@ -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 = [] |