search input field,
[wolnelektury.git] / apps / search / index.py
index c2dfdee..cc478ee 100644 (file)
@@ -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.