Correction bug #20. The solution is mainly to make sure that the index is recalculated - small optimization
--- a/web/hdabo/wp_utils.py Mon Jul 11 17:03:23 2011 +0200
+++ b/web/hdabo/wp_utils.py Mon Jul 11 17:20:30 2011 +0200
@@ -178,11 +178,8 @@
results = SearchQuerySet().filter(title=ts.tag.label).filter_or(description=ts.tag.label).filter(**kwargs)
if len(results) > 0:
ts.index_note += results[0].score
-# results = SearchQuerySet().filter(description=ts.tag.label).filter(**kwargs)
-# if len(results) > 0:
-# ts.index_note += results[0].score
+ ts.save()
- ts.save()
ts_list.append(ts)
ts_list.sort(key=lambda t: (-t.index_note, t.order))
for k, ts in enumerate(ts_list):