Skip to content

Commit

Permalink
chore(merge): master into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bonita-ci committed Dec 4, 2024
2 parents 868e545 + 25af5b4 commit 083e1e9
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,17 @@ public SearchResult<IApplication> searchIApplications(final SearchOptions search

protected SearchResult<IApplication> internalSearchIApplications(ServiceAccessor serviceAccessor,
SearchApplicationDescriptor appSearchDescriptor, SearchOptions searchOptions) throws SearchException {
if(searchOptions.getFilters().size() == 1) {
// Avoid a search query for a search by token to benefit from the cache optimization
final SearchFilter searchFilter = searchOptions.getFilters().get(0);
if (TOKEN.equals(searchFilter.getField())) {
try {
return new SearchResultImpl<>(1, List.of(getIApplicationByToken((String) searchFilter.getValue())));
} catch (ApplicationNotFoundException e) {
return new SearchResultImpl<>(0, List.of());
}
}
}
final ApplicationModelConverter converter = getApplicationModelConverter(serviceAccessor.getPageService());
final ApplicationService applicationService = serviceAccessor.getApplicationService();
final Optional<SearchFilter> filterOnUserId = searchOptions.getFilters().stream()
Expand Down

0 comments on commit 083e1e9

Please sign in to comment.