Show More
@@ -3,7 +3,7 b'' | |||||
3 | rhodecode.controllers.search |
|
3 | rhodecode.controllers.search | |
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
5 |
|
5 | |||
6 |
Search controller for |
|
6 | Search controller for RhodeCode | |
7 |
|
7 | |||
8 | :created_on: Aug 7, 2010 |
|
8 | :created_on: Aug 7, 2010 | |
9 | :author: marcink |
|
9 | :author: marcink | |
@@ -30,7 +30,8 b' from pylons import request, config, tmpl' | |||||
30 |
|
30 | |||
31 | from rhodecode.lib.auth import LoginRequired |
|
31 | from rhodecode.lib.auth import LoginRequired | |
32 | from rhodecode.lib.base import BaseController, render |
|
32 | from rhodecode.lib.base import BaseController, render | |
33 |
from rhodecode.lib.indexers import CHGSETS_SCHEMA, SCHEMA, CHGSET_IDX_NAME, |
|
33 | from rhodecode.lib.indexers import CHGSETS_SCHEMA, SCHEMA, CHGSET_IDX_NAME, \ | |
|
34 | IDX_NAME, WhooshResultWrapper | |||
34 |
|
35 | |||
35 | from webhelpers.paginate import Page |
|
36 | from webhelpers.paginate import Page | |
36 | from webhelpers.util import update_params |
|
37 | from webhelpers.util import update_params | |
@@ -58,20 +59,20 b' class SearchController(BaseController):' | |||||
58 | c.cur_search = search_type = {'content': 'content', |
|
59 | c.cur_search = search_type = {'content': 'content', | |
59 | 'commit': 'message', |
|
60 | 'commit': 'message', | |
60 | 'path': 'path', |
|
61 | 'path': 'path', | |
61 |
'repository': 'repository' |
|
62 | 'repository': 'repository' | |
62 | .get(c.cur_type, 'content') |
|
63 | }.get(c.cur_type, 'content') | |
63 |
|
64 | |||
64 | index_name = { |
|
65 | index_name = { | |
65 | 'content': IDX_NAME, |
|
66 | 'content': IDX_NAME, | |
66 | 'commit': CHGSET_IDX_NAME, |
|
67 | 'commit': CHGSET_IDX_NAME, | |
67 |
'path': IDX_NAME |
|
68 | 'path': IDX_NAME | |
68 |
|
|
69 | }.get(c.cur_type, IDX_NAME) | |
69 |
|
70 | |||
70 | schema_defn = { |
|
71 | schema_defn = { | |
71 | 'content': SCHEMA, |
|
72 | 'content': SCHEMA, | |
72 | 'commit': CHGSETS_SCHEMA, |
|
73 | 'commit': CHGSETS_SCHEMA, | |
73 |
'path': SCHEMA |
|
74 | 'path': SCHEMA | |
74 |
|
|
75 | }.get(c.cur_type, SCHEMA) | |
75 |
|
76 | |||
76 | log.debug('IDX: %s' % index_name) |
|
77 | log.debug('IDX: %s' % index_name) | |
77 | log.debug('SCHEMA: %s' % schema_defn) |
|
78 | log.debug('SCHEMA: %s' % schema_defn) | |
@@ -138,6 +139,5 b' class SearchController(BaseController):' | |||||
138 | log.error(traceback.format_exc()) |
|
139 | log.error(traceback.format_exc()) | |
139 | c.runtime = _('An error occurred during this search operation') |
|
140 | c.runtime = _('An error occurred during this search operation') | |
140 |
|
141 | |||
141 |
|
||||
142 | # Return a rendered template |
|
142 | # Return a rendered template | |
143 | return render('/search/search.html') |
|
143 | return render('/search/search.html') |
General Comments 0
You need to be logged in to leave comments.
Login now