From: Radek Czajka Date: Fri, 30 Dec 2011 11:55:52 +0000 (+0100) Subject: search fixes X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/d90edc4826d6c3d3a40f52fa5c88cf4b1741ab63?ds=sidebyside;hp=--cc search fixes --- d90edc4826d6c3d3a40f52fa5c88cf4b1741ab63 diff --git a/apps/search/index.py b/apps/search/index.py index 10069e4e4..6c7690146 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -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 index 000000000..9639a5ae7 --- /dev/null +++ b/apps/search/management/commands/reindex.py @@ -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() diff --git a/lib/librarian b/lib/librarian index a34b95aa7..cbabbdaa7 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit a34b95aa7ba5fd4838541d1cdcd28358fb808062 +Subproject commit cbabbdaa7ab6c6be8cd22b77860331444ddf6119 diff --git a/requirements.txt b/requirements.txt index ed684cc53..2b69d7f6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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