Skip to content

Commit

Permalink
Timing
Browse files Browse the repository at this point in the history
  • Loading branch information
benbosman committed Oct 25, 2023
1 parent 5a43e6b commit 16095af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,15 @@ public SearchResultsResource getSearchObjects(@RequestParam(name = "query", requ

//Get the Search results in JSON format
try {
log.info("start getSearchObjects");
SearchResultsRest searchResultsRest = discoveryRestRepository.getSearchObjects(query, dsoTypes, dsoScope,
configuration, searchFilters, page, utils.obtainProjection());
log.info("end getSearchObjects");

//Convert the Search JSON results to paginated HAL resources
log.info("start SearchResultsResource");
SearchResultsResource searchResultsResource = new SearchResultsResource(searchResultsRest, utils, page);
log.info("end SearchResultsResource");
halLinkService.addLinks(searchResultsResource, page);
return searchResultsResource;
} catch (IllegalArgumentException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public class ConverterService {
public <M, R> R toRest(M modelObject, Projection projection) {
M transformedModel = projection.transformModel(modelObject);
DSpaceConverter<M, R> converter = requireConverter(modelObject.getClass());
log.info("start convert " + modelObject.getClass());
R restObject = converter.convert(transformedModel, projection);
log.info("end convert " + modelObject.getClass());
if (restObject instanceof BaseObjectRest) {
BaseObjectRest baseObjectRest = (BaseObjectRest) restObject;
// This section will verify whether the current user has permissions to retrieve the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,23 @@ public SearchResultsRest getSearchObjects(final String query, final List<String>
DiscoverQuery discoverQuery = null;

try {
log.info("start buildQuery");
discoverQuery = queryBuilder
.buildQuery(context, scopeObject, discoveryConfiguration, query, searchFilters, dsoTypes, page);
log.info("end buildQuery");
searchResult = searchService.search(context, scopeObject, discoverQuery);

} catch (SearchServiceException e) {
log.error("Error while searching with Discovery", e);
throw new IllegalArgumentException("Error while searching with Discovery: " + e.getMessage());
}

return discoverResultConverter
.convert(context, query, dsoTypes, configuration, dsoScope, searchFilters, page, searchResult,
discoveryConfiguration, projection);
log.info("start convert");
SearchResultsRest convert = discoverResultConverter
.convert(context, query, dsoTypes, configuration, dsoScope, searchFilters, page, searchResult,
discoveryConfiguration, projection);
log.info("end convert");
return convert;
}

public FacetConfigurationRest getFacetsConfiguration(final String dsoScope, final String configuration) {
Expand Down

0 comments on commit 16095af

Please sign in to comment.