fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
9977ccb
)
large boost for multiple results
author
Jan Szejko
<janek37@gmail.com>
Mon, 19 Feb 2018 12:10:15 +0000
(13:10 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Mon, 19 Feb 2018 12:10:15 +0000
(13:10 +0100)
src/search/index.py
patch
|
blob
|
history
diff --git
a/src/search/index.py
b/src/search/index.py
index
5cae3e3
..
ab3286a
100644
(file)
--- 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:
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
f
or book %d; tried to merge with %d" % (self.book_id, other.book_id))
self._hits += other._hits
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):
return self
def get_book(self):