mirror of
https://github.com/searxng/searxng.git
synced 2025-07-23 05:09:17 +02:00
[enh] add quick answer functionality with an example answerer
This commit is contained in:
parent
55dc538398
commit
971ed0abd1
7 changed files with 156 additions and 4 deletions
|
@ -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 = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue