Fixes PostgreSQL search weights calculus.

pull/4539/head
Bertrand Bordage 2018-05-13 01:18:01 +02:00
rodzic d411fee905
commit 9b432dbecd
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -98,11 +98,11 @@ def set_weights():
BOOSTS_WEIGHTS.extend(determine_boosts_weights())
weights = [w for w, c in BOOSTS_WEIGHTS]
min_weight = min(weights)
max_weight = max(weights)
if min_weight <= 0:
if min_weight == 0:
min_weight = -0.1
weights = [w - min_weight for w in weights]
max_weight = max(weights)
WEIGHTS_VALUES.extend([w / max_weight
for w in reversed(weights)])