[mod] scoring

This commit is contained in:
asciimoo 2013-10-28 11:38:33 +01:00
parent 9db980ff41
commit ec95fddce2
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ def search(query, request, selected_categories):
for i,res in enumerate(flat_res): for i,res in enumerate(flat_res):
res['parsed_url'] = urlparse(res['url']) res['parsed_url'] = urlparse(res['url'])
res['engines'] = [res['engine']] res['engines'] = [res['engine']]
score = int((flat_len - i)/engines_len)*settings.weights.get(res['engine'], 1) score = int((flat_len - i)/engines_len)*settings.weights.get(res['engine'], 1)+1
duplicated = False duplicated = False
for new_res in results: for new_res in results:
if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\ if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\