Query fragments also by book id.
authorMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 2 Feb 2012 09:39:09 +0000 (10:39 +0100)
committerMarcin Koziej <marcin.koziej@nowoczesnapolska.org.pl>
Thu, 2 Feb 2012 09:39:09 +0000 (10:39 +0100)
apps/search/index.py

index 8ea3124..b4ecc96 100644 (file)
@@ -732,7 +732,7 @@ class SearchResult(object):
 
         for f in frags:
             try:
-                frag = catalogue.models.Fragment.objects.get(anchor=f[FRAGMENT])
+                frag = catalogue.models.Fragment.objects.get(anchor=f[FRAGMENT], book__id=self.book_id)
             except catalogue.models.Fragment.DoesNotExist:
                 # stale index
                 continue