forked from zaclys/searxng
[enh] improve yacy engine
This commit is contained in:
parent
6042f2bc53
commit
7e30633edd
|
@ -68,9 +68,18 @@ def response(resp):
|
|||
|
||||
search_results = raw_search_results.get('channels', {})[0].get('items', [])
|
||||
|
||||
if resp.search_params['category'] == 'general':
|
||||
# parse general results
|
||||
for result in search_results:
|
||||
# parse image results
|
||||
if result.get('image'):
|
||||
# append result
|
||||
results.append({'url': result['url'],
|
||||
'title': result['title'],
|
||||
'content': '',
|
||||
'img_src': result['image'],
|
||||
'template': 'images.html'})
|
||||
|
||||
# parse general results
|
||||
else:
|
||||
publishedDate = parser.parse(result['pubDate'])
|
||||
|
||||
# append result
|
||||
|
@ -79,16 +88,6 @@ def response(resp):
|
|||
'content': result['description'],
|
||||
'publishedDate': publishedDate})
|
||||
|
||||
elif resp.search_params['category'] == 'images':
|
||||
# parse image results
|
||||
for result in search_results:
|
||||
# append result
|
||||
results.append({'url': result['url'],
|
||||
'title': result['title'],
|
||||
'content': '',
|
||||
'img_src': result['image'],
|
||||
'template': 'images.html'})
|
||||
|
||||
#TODO parse video, audio and file results
|
||||
|
||||
# return results
|
||||
|
|
Loading…
Reference in New Issue