Changeset - 88b0e82bcba4
[Not reviewed]
beta
0 3 0
Indra Talip - 13 years ago 2012-07-21 06:01:32
indra.talip@gmail.com
rename changeset index key to match raw_id rather than path for greater consistency
3 files changed with 12 insertions and 12 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/indexers/__init__.py
Show inline comments
 
@@ -73,7 +73,7 @@ FORMATTER = HtmlFormatter('span', betwee
 
FRAGMENTER = ContextFragmenter(200)
 

	
 
CHGSETS_SCHEMA = Schema(
 
    path=ID(unique=True, stored=True),
 
    raw_id=ID(unique=True, stored=True),
 
    revision=NUMERIC(unique=True, stored=True),
 
    last=BOOLEAN(),
 
    owner=TEXT(),
 
@@ -209,15 +209,15 @@ class WhooshResultWrapper(object):
 
    def get_full_content(self, docid):
 
        res = self.searcher.stored_fields(docid[0])
 
        log.debug('result: %s' % res)
 
        full_repo_path = jn(self.repo_location, res['repository'])
 
        f_path = res['path'].split(full_repo_path)[-1]
 
        f_path = f_path.lstrip(os.sep)
 
        res.update({'f_path': f_path})
 

	
 
        if self.search_type == 'content':
 
            full_repo_path = jn(self.repo_location, res['repository'])
 
            f_path = res['path'].split(full_repo_path)[-1]
 
            f_path = f_path.lstrip(os.sep)
 
            content_short = self.get_short_content(res, docid[1])
 
            res.update({'content_short': content_short,
 
                        'content_short_hl': self.highlight(content_short)})
 
                        'content_short_hl': self.highlight(content_short),
 
                        'f_path': f_path
 
                      })
 
        elif self.search_type == 'message':
 
            res.update({'message_hl': self.highlight(res['message'])})
 

	
rhodecode/lib/indexers/daemon.py
Show inline comments
 
@@ -179,7 +179,7 @@ class WhooshIndexingDaemon(object):
 
        indexed=0
 
        for cs in repo[start_rev:]:
 
            writer.add_document(
 
                path=unicode(cs.raw_id),
 
                raw_id=unicode(cs.raw_id),
 
                owner=unicode(repo.contact),
 
                repository=safe_unicode(repo_name),
 
                author=cs.author,
 
@@ -231,8 +231,8 @@ class WhooshIndexingDaemon(object):
 
                    if last_rev == 0 or len(revs) > last_rev + 1:
 
                        # delete the docs in the index for the previous last changeset(s)
 
                        for hit in results:
 
                            q = qp.parse(u"last:t AND %s AND path:%s" % 
 
                                            (repo_name, hit['path']))
 
                            q = qp.parse(u"last:t AND %s AND raw_id:%s" % 
 
                                            (repo_name, hit['raw_id']))
 
                            writer.delete_by_query(q)
 

	
 
                        # index from the previous last changeset + all new ones
rhodecode/templates/search/search_commit.html
Show inline comments
 
@@ -5,8 +5,8 @@
 
    <div class="table">
 
        <div id="body${cnt}" class="codeblock">
 
            <div class="code-header">
 
                <div class="search-path">${h.link_to(h.literal('%s &raquo; %s' % (sr['repository'],sr['f_path'])),
 
                h.url('changeset_home',repo_name=sr['repository'],revision=sr['path']))}
 
                <div class="search-path">${h.link_to(h.literal('%s &raquo; %s' % (sr['repository'],sr['raw_id'])),
 
                h.url('changeset_home',repo_name=sr['repository'],revision=sr['raw_id']))}
 
                </div>
 
            </div>
 
            <div class="left">
0 comments (0 inline, 0 general)