Skip to content

Commit 97c66ec

Browse files
committed
showing most relevant label with fewer documents
1 parent 998a50c commit 97c66ec

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

vis/js/reducers/contextLine.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,20 @@ const contextLine = (state = {}, action) => {
6767

6868
/**
6969
* Returns the search modifier (how the searched papers are selected).
70-
*
70+
*
7171
* @param {Object} config the config object
7272
* @param {Object} context the context object
73-
*
73+
*
7474
* @returns {string} either most-recent, most-relevant or null
7575
*/
7676
export const getModifier = (config, context) => {
7777
if (
7878
!context.params ||
7979
!exists(context.params.sorting) ||
80-
context.num_documents < config.max_documents
80+
(context.num_documents < config.max_documents &&
81+
// temporarily allowing most relevant label for fewer documents
82+
// (after a backend change this should be removed and refactored)
83+
context.params.sorting !== "most-relevant")
8184
) {
8285
return null;
8386
}

0 commit comments

Comments
 (0)