fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log parallel job exceptions
[wolnelektury.git]
/
apps
/
catalogue
/
models.py
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
5846f53
..
0863d5b
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-626,8
+626,12
@@
class Book(models.Model):
return result.wait()
def search_index(self):
return result.wait()
def search_index(self):
- with search.Index() as idx:
+ idx = search.ReusableIndex()
+ idx.open()
+ try:
idx.index_book(self)
idx.index_book(self)
+ finally:
+ idx.close()
@classmethod
def from_xml_file(cls, xml_file, **kwargs):
@classmethod
def from_xml_file(cls, xml_file, **kwargs):