From 605de5807fccf3b9d68a944662743ac95338dec1 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Mon, 2 Mar 2020 18:50:11 +0100 Subject: [PATCH] use sorting by relvelance to avoid very large resource retrieval closes https://github.com/datacite/datacite/issues/976 some requests retrieve very large resources together, we cannot filtered them in the query but sorting the resources differently (like in fabrica by relevance) helps. --- lib/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.rb b/lib/api.rb index eaacae45..57dab366 100644 --- a/lib/api.rb +++ b/lib/api.rb @@ -14,7 +14,7 @@ def get_works(params = {}) 'page[number]' => params.fetch('page[number]', 1), 'page[size]' => params.fetch('page[size]', 25), ids: params.fetch(:ids, nil), - sort: params.fetch(:sort, nil), + sort: 'relevance', query: params.fetch(:query, nil), year: params.fetch('year', nil), registered: params.fetch('registered', nil),