Skip to content

Commit

Permalink
Set solr timeAllowed to 60s by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ato committed Aug 4, 2023
1 parent a6d876b commit 9d4c386
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/src/bamboo/api/DataApiController.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ public void search(@RequestParam MultiValueMap<String, String> params,
var solrParams = new LinkedMultiValueMap<String, String>();
solrParams.set("fq", "+auGov:true -discoverable:false");
solrParams.addAll(params);
var timeAllowed = Optional.ofNullable(solrParams.getFirst("timeAllowed")).map(Long::parseLong).orElse(0L);
if (timeAllowed > 60000L) timeAllowed = 60000L;
long maxTimeAllowed = 60000L;
var timeAllowed = Optional.ofNullable(solrParams.getFirst("timeAllowed")).map(Long::parseLong).orElse(maxTimeAllowed);
if (timeAllowed > maxTimeAllowed) timeAllowed = maxTimeAllowed;
solrParams.set("timeAllowed", String.valueOf(timeAllowed));
if (!solrParams.containsKey("wt")) {
solrParams.add("wt", "json");
Expand Down

0 comments on commit 9d4c386

Please sign in to comment.