Commit 7f3aa83e authored by Matija Obreza's avatar Matija Obreza
Browse files

API: Reduce default page size for Subset and Dataset lists

parent f891d892
......@@ -340,7 +340,7 @@ public class DatasetController extends ApiBaseController {
@RequestBody(required = false) DatasetFilter filter) throws IOException, SearchException {
FilterInfo<DatasetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, DatasetFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasetsForCurrentUser(filterInfo.filter, page.toPageRequest(100, Sort.Direction.DESC, "lastModifiedDate")));
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasetsForCurrentUser(filterInfo.filter, page.toPageRequest(10, Sort.Direction.DESC, "lastModifiedDate")));
}
/**
......@@ -355,7 +355,7 @@ public class DatasetController extends ApiBaseController {
@RequestBody(required = false) DatasetFilter filter) throws IOException, SearchException {
FilterInfo<DatasetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, DatasetFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasets(filterInfo.filter, page.toPageRequest(100, Sort.Direction.ASC, "id")));
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasets(filterInfo.filter, page.toPageRequest(10, Sort.Direction.ASC, "id")));
}
/**
......@@ -371,7 +371,7 @@ public class DatasetController extends ApiBaseController {
FilterInfo<DatasetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, DatasetFilter.class);
FilteredPage<Dataset> pageRes = new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasets(filterInfo.filter, page.toPageRequest(100, Sort.Direction.ASC, "id")));
FilteredPage<Dataset> pageRes = new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, datasetService.listDatasets(filterInfo.filter, page.toPageRequest(10, Sort.Direction.ASC, "id")));
Map<String, ElasticsearchService.TermResult> suggestionRes = datasetService.getSuggestions(filterInfo.filter);
return DatasetSuggestionPage.from(pageRes, suggestionRes);
......@@ -447,7 +447,7 @@ public class DatasetController extends ApiBaseController {
@JsonView({ JsonViews.Public.class })
@GetMapping(value = "/accessions/{uuid}", produces = { MediaType.APPLICATION_JSON_VALUE, CSVMessageConverter.TEXT_CSV_VALUE })
public Page<DatasetAccessionRef> listAccessions(@PathVariable("uuid") final UUID uuid, final Pagination page) throws NotFoundElement {
return datasetService.listAccessions(datasetService.getDataset(uuid, null), page.toPageRequest(100));
return datasetService.listAccessions(datasetService.getDataset(uuid, null), page.toPageRequest(50));
}
/**
......@@ -463,7 +463,7 @@ public class DatasetController extends ApiBaseController {
public Page<Accession> listFullAccessions(@PathVariable("uuid") final UUID uuid, final Pagination page) throws NotFoundElement, SearchException {
AccessionFilter filter = new AccessionFilter();
filter.datasets = Sets.newHashSet(uuid);
return accessionService.list(filter, page.toPageRequest(100));
return accessionService.list(filter, page.toPageRequest(50));
}
/**
......
......@@ -187,7 +187,7 @@ public class SubsetController extends ApiBaseController {
@RequestBody(required = false) SubsetFilter filter) throws IOException, SearchException {
FilterInfo<SubsetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, SubsetFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.list(filterInfo.filter, page.toPageRequest(100, Sort.Direction.ASC, "id")));
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.list(filterInfo.filter, page.toPageRequest(10, Sort.Direction.ASC, "id")));
}
/**
......@@ -205,7 +205,7 @@ public class SubsetController extends ApiBaseController {
FilterInfo<SubsetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, SubsetFilter.class);
FilteredPage<Subset> pageRes = new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.list(filterInfo.filter, page.toPageRequest(100, Sort.Direction.ASC, "id")));
FilteredPage<Subset> pageRes = new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.list(filterInfo.filter, page.toPageRequest(10, Sort.Direction.ASC, "id")));
Map<String, ElasticsearchService.TermResult> suggestionRes = subsetService.getSuggestions(filterInfo.filter);
return SubsetSuggestionPage.from(pageRes, suggestionRes);
......@@ -224,7 +224,7 @@ public class SubsetController extends ApiBaseController {
@RequestBody(required = false) SubsetFilter filter) throws IOException {
FilterInfo<SubsetFilter> filterInfo = shortFilterProcessor.processFilter(filterCode, filter, SubsetFilter.class);
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.listSubsetsForCurrentUser(filterInfo.filter, page.toPageRequest(100, Sort.Direction.DESC, "lastModifiedDate")));
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, subsetService.listSubsetsForCurrentUser(filterInfo.filter, page.toPageRequest(10, Sort.Direction.DESC, "lastModifiedDate")));
}
/**
......@@ -291,7 +291,7 @@ public class SubsetController extends ApiBaseController {
@JsonView({ JsonViews.Public.class })
@GetMapping(value = "/accessions/{uuid}", produces = { MediaType.APPLICATION_JSON_VALUE, CSVMessageConverter.TEXT_CSV_VALUE })
public Page<SubsetAccessionRef> listAccessions(@PathVariable("uuid") final UUID uuid, final Pagination page) throws NotFoundElement {
return subsetService.listAccessions(subsetService.getSubset(uuid), page.toPageRequest(100));
return subsetService.listAccessions(subsetService.getSubset(uuid), page.toPageRequest(50));
}
/**
......@@ -307,7 +307,7 @@ public class SubsetController extends ApiBaseController {
public Page<Accession> listFullAccessions(@PathVariable("uuid") final UUID uuid, final Pagination page) throws NotFoundElement, SearchException {
AccessionFilter filter = new AccessionFilter();
filter.subsets = Sets.newHashSet(uuid);
return accessionService.list(filter, page.toPageRequest(100));
return accessionService.list(filter, page.toPageRequest(50));
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment