fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'production' into pretty
[wolnelektury.git]
/
apps
/
search
/
index.py
diff --git
a/apps/search/index.py
b/apps/search/index.py
index
c2dfdee
..
cc478ee
100644
(file)
--- a/
apps/search/index.py
+++ b/
apps/search/index.py
@@
-610,20
+610,20
@@
class SearchResult(object):
# remove duplicate sections
sections = {}
# remove duplicate sections
sections = {}
-
+
for s in sect:
si = s[POSITION][POSITION_INDEX]
# skip existing
if si in sections:
if sections[si]['score'] >= s[SCORE]:
continue
for s in sect:
si = s[POSITION][POSITION_INDEX]
# skip existing
if si in sections:
if sections[si]['score'] >= s[SCORE]:
continue
-
+
m = {'score': s[SCORE],
m = {'score': s[SCORE],
- '
header_index': s[POSITION][POSITION_INDEX]
+ '
section_number': s[POSITION][POSITION_INDEX] + 1,
}
m.update(s[OTHER])
sections[si] = m
}
m.update(s[OTHER])
sections[si] = m
-
+
hits = sections.values()
for f in frags:
hits = sections.values()
for f in frags:
@@
-1030,7
+1030,6
@@
class Search(IndexStore):
# return None
# return None
-
def get_snippets(self, scoreDoc, query, field='content'):
"""
Returns a snippet for found scoreDoc.
def get_snippets(self, scoreDoc, query, field='content'):
"""
Returns a snippet for found scoreDoc.