fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
paralell indexing
[wolnelektury.git]
/
apps
/
catalogue
/
models.py
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
0863d5b
..
1a2e8f8
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-626,7
+626,14
@@
class Book(models.Model):
return result.wait()
def search_index(self):
return result.wait()
def search_index(self):
- idx = search.ReusableIndex()
+ if settings.SEARCH_INDEX_PARALLEL:
+ if instance(settings.SEARCH_INDEX_PARALLEL, int):
+ idx = search.ReusableIndex(threads=4)
+ else:
+ idx = search.ReusableIndex()
+ else:
+ idx = search.Index()
+
idx.open()
try:
idx.index_book(self)
idx.open()
try:
idx.index_book(self)