summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2012-09-20 16:12:13 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2012-09-20 16:12:13 (GMT)
commitd6254a65647b6d9687ba1fd8e8bd3993371a189a (patch)
tree343d67e6d2e7f6bde4615a84b14b8c40a22471cb
parenta0dd4db3c1d5301e9d4fbbbea97943fcf0e51fdc (diff)
downloadpfwb-ged-proto-d6254a65647b6d9687ba1fd8e8bd3993371a189a.zip
pfwb-ged-proto-d6254a65647b6d9687ba1fd8e8bd3993371a189a.tar.gz
pfwb-ged-proto-d6254a65647b6d9687ba1fd8e8bd3993371a189a.tar.bz2
log indexing steps with times
-rwxr-xr-xserver/search_server.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/search_server.py b/server/search_server.py
index 7853dea..a8e2282 100755
--- a/server/search_server.py
+++ b/server/search_server.py
@@ -55,7 +55,7 @@ class SearchHandler(SCGIHandler):
def produce(self, env, bodysize, input, output):
if self.debug:
- print 'Request received at', time.strftime('[%Y-%m-%d %H:%M]')
+ print 'Request received at', time.strftime('[%Y-%m-%d %H:%M:%S]')
print ' - body size:', bodysize
uri = env.get('REQUEST_URI')[len('/search/'):]
@@ -143,6 +143,8 @@ class SearchHandler(SCGIHandler):
print >> output, 'Redirection'
def index(self, filename, id):
+ if self.debug:
+ print ' - extracting text at', time.strftime('[%Y-%m-%d %H:%M:%S]')
cmd = ['pdftotext', filename, '-']
try:
p = subprocess.Popen(cmd,
@@ -159,8 +161,14 @@ class SearchHandler(SCGIHandler):
if self.debug:
print 'E: error running pdftotext (rc:%d)' % p.returncode
return False
+ if self.debug:
+ print ' - adding to solr at', time.strftime('[%Y-%m-%d %H:%M:%S]')
self.solr.add([{'id': id, 'text': unicode(stdout, 'utf-8')}])
+ if self.debug:
+ print ' - commiting solr at', time.strftime('[%Y-%m-%d %H:%M:%S]')
self.solr.commit()
+ if self.debug:
+ print ' - done at', time.strftime('[%Y-%m-%d %H:%M:%S]')
return True
def error_page(self, output, message):