From cf287e8434ef1d5e84be9f6a3047f73eb0721285 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 19 Feb 2018 13:10:15 +0100 Subject: [PATCH] large boost for multiple results --- src/search/index.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/search/index.py b/src/search/index.py index 5cae3e3e6..ab3286aee 100644 --- a/src/search/index.py +++ b/src/search/index.py @@ -573,10 +573,9 @@ class SearchResult(object): def merge(self, other): if self.book_id != other.book_id: - raise ValueError("this search result is or book %d; tried to merge with %d" % (self.book_id, other.book_id)) + raise ValueError("this search result is for book %d; tried to merge with %d" % (self.book_id, other.book_id)) self._hits += other._hits - if other.score > self.score: - self._score = other._score + self._score += max(other._score, 0) + 0.5 return self def get_book(self): -- 2.20.1