search: updated api and switched to desc:date as default
This commit is contained in:
parent
0bdcb31a44
commit
1f16da1ab3
2 changed files with 11 additions and 5 deletions
|
|
@ -33,7 +33,7 @@ log = logging.getLogger(__name__)
|
|||
|
||||
@jsonrpc_method()
|
||||
def search(request, apiuser, search_query, search_type, page_limit=Optional(10),
|
||||
page=Optional(1), search_sort=Optional('newfirst'),
|
||||
page=Optional(1), search_sort=Optional('desc:date'),
|
||||
repo_name=Optional(None), repo_group_name=Optional(None)):
|
||||
"""
|
||||
Fetch Full Text Search results using API.
|
||||
|
|
@ -51,9 +51,15 @@ def search(request, apiuser, search_query, search_type, page_limit=Optional(10),
|
|||
:type page_limit: Optional(int)
|
||||
:param page: Page number. Default first page.
|
||||
:type page: Optional(int)
|
||||
:param search_sort: Search sort order. Default newfirst. The following are valid options:
|
||||
* newfirst
|
||||
* oldfirst
|
||||
:param search_sort: Search sort order.Must start with asc: or desc: Default desc:date.
|
||||
The following are valid options:
|
||||
* asc|desc:message.raw
|
||||
* asc|desc:date
|
||||
* asc|desc:author.email.raw
|
||||
* asc|desc:message.raw
|
||||
* newfirst (old legacy equal to desc:date)
|
||||
* oldfirst (old legacy equal to asc:date)
|
||||
|
||||
:type search_sort: Optional(str)
|
||||
:param repo_name: Filter by one repo. Default is all.
|
||||
:type repo_name: Optional(str)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class SearchParamsSchema(colander.MappingSchema):
|
|||
validator=colander.OneOf(['content', 'path', 'commit', 'repository']))
|
||||
search_sort = colander.SchemaNode(
|
||||
colander.String(),
|
||||
missing='newfirst',
|
||||
missing='desc:date',
|
||||
validator=sort_validator)
|
||||
search_max_lines = colander.SchemaNode(
|
||||
colander.Integer(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue