From 12b43ffbed39658a05f3fcdc52f8887f566333e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sat, 22 Dec 2012 09:34:21 +0100 Subject: [PATCH] Do a prepend instead of an append to generate search index. Allow reverse date order results display --- search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/search.py b/search.py index cdad7c6..890ed94 100644 --- a/search.py +++ b/search.py @@ -109,7 +109,7 @@ class Search: if not word in hashtable: hashtable[word] = [] if not index in hashtable[word]: - hashtable[word].append([index, word_weight]) + hashtable[word].insert(0, [index, word_weight]) else: weight = hashtable[word][1] hashtable[word][1] = weight + word_weight