+ def search_books(self, query, filter=None, max_results=10):
+ bks = []
+ tops = self.searcher.search(query, filter, max_results)
+ for found in tops.scoreDocs:
+ doc = self.searcher.doc(found.doc)
+ bks.append(catalogue.models.Book.objects.get(id=doc.get("book_id")))
+ return bks
+