summaryrefslogtreecommitdiff
path: root/indexer.py
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2010-11-21 13:00:01 +0100
committeryvesf <yvesf-git@xapek.org>2010-11-21 13:00:01 +0100
commit1c34f8b6824b38c5a2698bbbd27a7aa7df51da9c (patch)
tree51a8a3f3278862fbe8cb3932d74a2941aae1bf84 /indexer.py
parent7385d9f5ba2cba49db24ee9c874f08fff641cb20 (diff)
downloadbooksearch-1c34f8b6824b38c5a2698bbbd27a7aa7df51da9c.tar.gz
booksearch-1c34f8b6824b38c5a2698bbbd27a7aa7df51da9c.zip
save
Diffstat (limited to 'indexer.py')
-rw-r--r--indexer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/indexer.py b/indexer.py
index 57e1c0f..1508bd4 100644
--- a/indexer.py
+++ b/indexer.py
@@ -77,6 +77,7 @@ def process_file(filepath):
print u"{0} processing {1}".format(os.getpid(), filepath)
inputfile = pyPdf.PdfFileReader(file(filepath, 'r'))
title = inputfile.getDocumentInfo().title
+
writer_metadata = index_metadata.writer()
writer_metadata.add_document(title=title, path=filepath, createtime=time.time())
writer_metadata.commit()
@@ -110,7 +111,8 @@ except KeyboardInterrupt:
pool.terminate()
except ImportError:
for filepath in filepaths:
- process_file(filepath)
+ #if process_file(filepath) == "KeyboardInterrupt":
+ break
print u"optimize indexes"
index_metadata.optimize()
index_metadata.close()