Show More
@@ -33,7 +33,7 b' log = logging.getLogger(__name__)' | |||||
33 |
|
33 | |||
34 | @jsonrpc_method() |
|
34 | @jsonrpc_method() | |
35 | def search(request, apiuser, search_query, search_type, page_limit=Optional(10), |
|
35 | def search(request, apiuser, search_query, search_type, page_limit=Optional(10), | |
36 |
page=Optional(1), search_sort=Optional(' |
|
36 | page=Optional(1), search_sort=Optional('desc:date'), | |
37 | repo_name=Optional(None), repo_group_name=Optional(None)): |
|
37 | repo_name=Optional(None), repo_group_name=Optional(None)): | |
38 | """ |
|
38 | """ | |
39 | Fetch Full Text Search results using API. |
|
39 | Fetch Full Text Search results using API. | |
@@ -51,9 +51,15 b' def search(request, apiuser, search_quer' | |||||
51 | :type page_limit: Optional(int) |
|
51 | :type page_limit: Optional(int) | |
52 | :param page: Page number. Default first page. |
|
52 | :param page: Page number. Default first page. | |
53 | :type page: Optional(int) |
|
53 | :type page: Optional(int) | |
54 |
:param search_sort: Search sort order. |
|
54 | :param search_sort: Search sort order.Must start with asc: or desc: Default desc:date. | |
55 | * newfirst |
|
55 | The following are valid options: | |
56 | * oldfirst |
|
56 | * asc|desc:message.raw | |
|
57 | * asc|desc:date | |||
|
58 | * asc|desc:author.email.raw | |||
|
59 | * asc|desc:message.raw | |||
|
60 | * newfirst (old legacy equal to desc:date) | |||
|
61 | * oldfirst (old legacy equal to asc:date) | |||
|
62 | ||||
57 | :type search_sort: Optional(str) |
|
63 | :type search_sort: Optional(str) | |
58 | :param repo_name: Filter by one repo. Default is all. |
|
64 | :param repo_name: Filter by one repo. Default is all. | |
59 | :type repo_name: Optional(str) |
|
65 | :type repo_name: Optional(str) |
@@ -44,7 +44,7 b' class SearchParamsSchema(colander.Mappin' | |||||
44 | validator=colander.OneOf(['content', 'path', 'commit', 'repository'])) |
|
44 | validator=colander.OneOf(['content', 'path', 'commit', 'repository'])) | |
45 | search_sort = colander.SchemaNode( |
|
45 | search_sort = colander.SchemaNode( | |
46 | colander.String(), |
|
46 | colander.String(), | |
47 |
missing=' |
|
47 | missing='desc:date', | |
48 | validator=sort_validator) |
|
48 | validator=sort_validator) | |
49 | search_max_lines = colander.SchemaNode( |
|
49 | search_max_lines = colander.SchemaNode( | |
50 | colander.Integer(), |
|
50 | colander.Integer(), |
General Comments 0
You need to be logged in to leave comments.
Login now