mirror of
				https://github.com/searxng/searxng
				synced 2024-01-01 19:24:07 +01:00 
			
		
		
		
	[enh] improve yacy engine
This commit is contained in:
		
							parent
							
								
									6042f2bc53
								
							
						
					
					
						commit
						7e30633edd
					
				
					 1 changed files with 12 additions and 13 deletions
				
			
		|  | @ -68,9 +68,18 @@ def response(resp): | ||||||
| 
 | 
 | ||||||
|     search_results = raw_search_results.get('channels', {})[0].get('items', []) |     search_results = raw_search_results.get('channels', {})[0].get('items', []) | ||||||
| 
 | 
 | ||||||
|     if resp.search_params['category'] == 'general': |     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 |         # parse general results | ||||||
|         for result in search_results: |         else: | ||||||
|             publishedDate = parser.parse(result['pubDate']) |             publishedDate = parser.parse(result['pubDate']) | ||||||
| 
 | 
 | ||||||
|             # append result |             # append result | ||||||
|  | @ -79,17 +88,7 @@ def response(resp): | ||||||
|                             'content': result['description'], |                             'content': result['description'], | ||||||
|                             'publishedDate': publishedDate}) |                             'publishedDate': publishedDate}) | ||||||
| 
 | 
 | ||||||
|     elif resp.search_params['category'] == 'images': |         #TODO parse video, audio and file results | ||||||
|         # 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 |     # return results | ||||||
|     return results |     return results | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Thomas Pointhuber
						Thomas Pointhuber