search fixes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 30 Dec 2011 11:55:52 +0000 (12:55 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 30 Dec 2011 11:55:52 +0000 (12:55 +0100)
apps/search/index.py
apps/search/management/commands/reindex.py [new file with mode: 0755]
lib/librarian
requirements.txt

index 10069e4..6c76901 100644 (file)
@@ -280,7 +280,7 @@ class Index(IndexStore):
             return
 
         def fix_format(text):
-            return re.sub("/$", "", text, flags=re.M)
+            return re.sub("(?m)/$", "", text)
 
         def add_part(snippets, **fields):
             doc = self.create_book_doc(book)
diff --git a/apps/search/management/commands/reindex.py b/apps/search/management/commands/reindex.py
new file mode 100755 (executable)
index 0000000..9639a5a
--- /dev/null
@@ -0,0 +1,16 @@
+from django.core.management.base import BaseCommand
+
+class Command(BaseCommand):
+    help = 'Reindex everything.'
+    args = ''
+
+    def handle(self, *args, **opts):
+        from catalogue.models import Book
+        import search
+        idx = search.ReusableIndex()
+        idx.open()
+        for b in Book.objects.all():
+            print b.title
+            idx.index_book(b, None)
+        print 'Reindexing tags.'
+        idx.index_tags()
index a34b95a..cbabbda 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a34b95aa7ba5fd4838541d1cdcd28358fb808062
+Subproject commit cbabbdaa7ab6c6be8cd22b77860331444ddf6119
index ed684cc..2b69d7f 100644 (file)
@@ -17,7 +17,7 @@ Feedparser>=4.1
 # PIL 
 PIL>=1.1.6
 mutagen>=1.17
-sorl-thumbnail>=11.09<12
+sorl-thumbnail>=11.09,<12
 
 # home-brewed & dependencies
 lxml>=2.2.2