mirror of
https://github.com/searxng/searxng.git
synced 2025-07-14 08:49:19 +02:00
[enh][mod] result handling refactor
Several changes has been made: - Parallel result merge - Scoring algorithm slightly changed (see result_score()) - Proper Thread locking on global data manipulation
This commit is contained in:
parent
0ad272c5cb
commit
b6c3cb0bdd
6 changed files with 321 additions and 292 deletions
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import json
|
||||
from mock import Mock
|
||||
from urlparse import ParseResult
|
||||
from searx import webapp
|
||||
from searx.testing import SearxTestCase
|
||||
|
@ -33,7 +34,12 @@ class ViewsTestCase(SearxTestCase):
|
|||
]
|
||||
|
||||
def search_mock(search_self, *args):
|
||||
search_self.results = self.test_results
|
||||
search_self.result_container = Mock(get_ordered_results=lambda: self.test_results,
|
||||
answers=set(),
|
||||
suggestions=set(),
|
||||
infoboxes=[],
|
||||
results=self.test_results,
|
||||
results_length=lambda: len(self.test_results))
|
||||
|
||||
webapp.Search.search = search_mock
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue