Skip to content

Commit

Permalink
added search sorting options date_created and date_hidden; fixes #476
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Aug 18, 2017
1 parent 0b71064 commit 35ac1c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions okapi/services/caches/search/SearchAssistant.php
Expand Up @@ -669,6 +669,8 @@ public function prepare_common_search_params()
case 'rcmds%':
$cl = "$X_TOPRATINGS / if($X_FOUNDS = 0, 1, $X_FOUNDS)";
break;
case 'date_created': $cl = "caches.date_created"; break;
case 'date_hidden': $cl = "caches.date_hidden"; break;
default:
throw new InvalidParam('order_by', "Unsupported field '$field'");
}
Expand Down
3 changes: 2 additions & 1 deletion okapi/services/caches/search/all/docs.xml
Expand Up @@ -256,7 +256,8 @@
a '-' sign to indicate a descending order.</p>

<p>Currently, fields which you can order by include: <b>code</b>, <b>name</b>,
<b>founds</b>, <b>rcmds</b>, <b>rcmds%</b> (tell us if you want more).</p>
<b>founds</b>, <b>rcmds</b>, <b>rcmds%</b>, <b>date_created</b>, <b>date_hidden</b>
(tell us if you want more).</p>

<p><b>Examples:</b></p>
<ul>
Expand Down

0 comments on commit 35ac1c2

Please sign in to comment.