Mercurial > kallithea
comparison rhodecode/lib/indexers/__init__.py @ 2642:88b0e82bcba4 beta
rename changeset index key to match raw_id rather than path for greater consistency
author | Indra Talip <indra.talip@gmail.com> |
---|---|
date | Sat, 21 Jul 2012 06:01:32 +0200 |
parents | 5f21a9dcb09d |
children | 2ad50c44b025 |
comparison
equal
deleted
inserted
replaced
2641:cfcd981d6679 | 2642:88b0e82bcba4 |
---|---|
71 IDX_NAME = 'HG_INDEX' | 71 IDX_NAME = 'HG_INDEX' |
72 FORMATTER = HtmlFormatter('span', between='\n<span class="break">...</span>\n') | 72 FORMATTER = HtmlFormatter('span', between='\n<span class="break">...</span>\n') |
73 FRAGMENTER = ContextFragmenter(200) | 73 FRAGMENTER = ContextFragmenter(200) |
74 | 74 |
75 CHGSETS_SCHEMA = Schema( | 75 CHGSETS_SCHEMA = Schema( |
76 path=ID(unique=True, stored=True), | 76 raw_id=ID(unique=True, stored=True), |
77 revision=NUMERIC(unique=True, stored=True), | 77 revision=NUMERIC(unique=True, stored=True), |
78 last=BOOLEAN(), | 78 last=BOOLEAN(), |
79 owner=TEXT(), | 79 owner=TEXT(), |
80 repository=ID(unique=True, stored=True), | 80 repository=ID(unique=True, stored=True), |
81 author=TEXT(stored=True), | 81 author=TEXT(stored=True), |
207 return slices | 207 return slices |
208 | 208 |
209 def get_full_content(self, docid): | 209 def get_full_content(self, docid): |
210 res = self.searcher.stored_fields(docid[0]) | 210 res = self.searcher.stored_fields(docid[0]) |
211 log.debug('result: %s' % res) | 211 log.debug('result: %s' % res) |
212 full_repo_path = jn(self.repo_location, res['repository']) | |
213 f_path = res['path'].split(full_repo_path)[-1] | |
214 f_path = f_path.lstrip(os.sep) | |
215 res.update({'f_path': f_path}) | |
216 | |
217 if self.search_type == 'content': | 212 if self.search_type == 'content': |
213 full_repo_path = jn(self.repo_location, res['repository']) | |
214 f_path = res['path'].split(full_repo_path)[-1] | |
215 f_path = f_path.lstrip(os.sep) | |
218 content_short = self.get_short_content(res, docid[1]) | 216 content_short = self.get_short_content(res, docid[1]) |
219 res.update({'content_short': content_short, | 217 res.update({'content_short': content_short, |
220 'content_short_hl': self.highlight(content_short)}) | 218 'content_short_hl': self.highlight(content_short), |
219 'f_path': f_path | |
220 }) | |
221 elif self.search_type == 'message': | 221 elif self.search_type == 'message': |
222 res.update({'message_hl': self.highlight(res['message'])}) | 222 res.update({'message_hl': self.highlight(res['message'])}) |
223 | 223 |
224 log.debug('result: %s' % res) | 224 log.debug('result: %s' % res) |
225 | 225 |