X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/f230a3850ec568f2281f085a076a6185d8c82b5c..3c12104d064098096eb5fe9c9ee122d0293e10f2:/apps/search/index.py diff --git a/apps/search/index.py b/apps/search/index.py index c2dfdee99..cc478ee53 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -610,20 +610,20 @@ class SearchResult(object): # 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 - + m = {'score': s[SCORE], - 'header_index': s[POSITION][POSITION_INDEX] + 'section_number': s[POSITION][POSITION_INDEX] + 1, } m.update(s[OTHER]) sections[si] = m - + hits = sections.values() for f in frags: @@ -1030,7 +1030,6 @@ class Search(IndexStore): # return None - def get_snippets(self, scoreDoc, query, field='content'): """ Returns a snippet for found scoreDoc.