fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wide PDF covers.
[wolnelektury.git]
/
apps
/
search
/
custom.py
diff --git
a/apps/search/custom.py
b/apps/search/custom.py
index
e6f559b
..
b3b704d
100644
(file)
--- a/
apps/search/custom.py
+++ b/
apps/search/custom.py
@@
-1,4
+1,7
@@
-
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
from sunburnt import sunburnt
from lxml import etree
import urllib
from sunburnt import sunburnt
from lxml import etree
import urllib
@@
-147,7
+150,7
@@
class CustomSolrInterface(sunburnt.SolrInterface):
break
start -= 1
break
start -= 1
- while end < totlen:
+ while end < totlen
- 1
:
if is_boundary(text[end + 1]):
break
end += 1
if is_boundary(text[end + 1]):
break
end += 1
@@
-179,7
+182,6
@@
class CustomSolrInterface(sunburnt.SolrInterface):
snip = text[start:end]
matches.sort(lambda a, b: cmp(b[0], a[0]))
snip = text[start:end]
matches.sort(lambda a, b: cmp(b[0], a[0]))
- print matches
for (s, e) in matches:
off = - start
for (s, e) in matches:
off = - start