##// END OF EJS Templates
Little better logging in whoosh indexer
marcink -
r2569:b98fd6fc beta
parent child Browse files
Show More
@@ -168,7 +168,9 b' class WhooshIndexingDaemon(object):'
168
168
169 idx = create_in(self.index_location, SCHEMA, indexname=IDX_NAME)
169 idx = create_in(self.index_location, SCHEMA, indexname=IDX_NAME)
170 writer = idx.writer()
170 writer = idx.writer()
171 log.debug('BUILDIN INDEX FOR EXTENSIONS %s' % INDEX_EXTENSIONS)
171 log.debug('BUILDING INDEX FOR EXTENSIONS %s '
172 'AND REPOS %s' % (INDEX_EXTENSIONS, self.repo_paths.keys()))
173
172 for repo_name, repo in self.repo_paths.items():
174 for repo_name, repo in self.repo_paths.items():
173 log.debug('building index @ %s' % repo.path)
175 log.debug('building index @ %s' % repo.path)
174 i_cnt = iwc_cnt = 0
176 i_cnt = iwc_cnt = 0
@@ -230,8 +232,11 b' class WhooshIndexingDaemon(object):'
230 # Loop over the files in the filesystem
232 # Loop over the files in the filesystem
231 # Assume we have a function that gathers the filenames of the
233 # Assume we have a function that gathers the filenames of the
232 # documents to be indexed
234 # documents to be indexed
233 ri_cnt = riwc_cnt = 0
235 ri_cnt_total = 0 # indexed
236 riwc_cnt_total = 0 # indexed with content
234 for repo_name, repo in self.repo_paths.items():
237 for repo_name, repo in self.repo_paths.items():
238 ri_cnt = 0 # indexed
239 riwc_cnt = 0 # indexed with content
235 for path in self.get_paths(repo):
240 for path in self.get_paths(repo):
236 path = safe_unicode(path)
241 path = safe_unicode(path)
237 if path in to_index or path not in indexed_paths:
242 if path in to_index or path not in indexed_paths:
@@ -241,9 +246,14 b' class WhooshIndexingDaemon(object):'
241 i, iwc = self.add_doc(writer, path, repo, repo_name)
246 i, iwc = self.add_doc(writer, path, repo, repo_name)
242 log.debug('re indexing %s' % path)
247 log.debug('re indexing %s' % path)
243 ri_cnt += i
248 ri_cnt += i
249 ri_cnt_total += 1
244 riwc_cnt += iwc
250 riwc_cnt += iwc
245 log.debug('added %s files %s with content for repo %s' % (
251 riwc_cnt_total += iwc
246 ri_cnt + riwc_cnt, riwc_cnt, repo.path)
252 log.debug('added %s files %s with content for repo %s' % (
253 ri_cnt + riwc_cnt, riwc_cnt, repo.path)
254 )
255 log.debug('indexed %s files in total and %s with content' % (
256 ri_cnt_total, riwc_cnt_total)
247 )
257 )
248 log.debug('>> COMMITING CHANGES <<')
258 log.debug('>> COMMITING CHANGES <<')
249 writer.commit(merge=True)
259 writer.commit(merge=True)
General Comments 0
You need to be logged in to leave comments. Login now