X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d80d9682f0487d7858d5a18221cbe68e41d38ad..2910709b1c3b5e2b7d526323f8d8ed03b13895e5:/apps/search/index.py diff --git a/apps/search/index.py b/apps/search/index.py index ead10b5dd..2a5c14f22 100644 --- a/apps/search/index.py +++ b/apps/search/index.py @@ -214,7 +214,7 @@ class Index(BaseIndex): q = NumericRangeQuery.newIntRange("tag_id", 0, Integer.MAX_VALUE, True, True) self.index.deleteDocuments(q) - for tag in catalogue.models.Tag.objects.all(): + for tag in catalogue.models.Tag.objects.exclude(category='set'): doc = Document() doc.add(NumericField("tag_id", Field.Store.YES, True).setIntValue(int(tag.id))) doc.add(Field("tag_name", tag.name, Field.Store.NO, Field.Index.ANALYZED)) @@ -650,9 +650,10 @@ class SearchResult(object): self.book_id = int(stored.get("book_id")) pd = stored.get("published_date") - if pd is None: - pd = 0 - self.published_date = int(pd) + try: + self.published_date = int(pd) + except ValueError: + self.published_date = 0 header_type = stored.get("header_type") # we have a content hit in some header of fragment