private SearchWsResponse doHandle(SearchRequest request) { try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = getOrganization(dbSession, request); ComponentQuery esQuery = buildEsQuery(organization, request); SearchIdResult<String> results = componentIndex.search(esQuery, new SearchOptions().setPage(request.getPage(), request.getPageSize())); List<ComponentDto> components = dbClient.componentDao().selectByUuids(dbSession, results.getIds()); Map<String, String> projectKeysByUuids = searchProjectsKeysByUuids(dbSession, components); return buildResponse(components, organization, projectKeysByUuids, Paging.forPageIndex(request.getPage()).withPageSize(request.getPageSize()).andTotal((int) results.getTotal())); } }
private SearchWsResponse doHandle(SearchRequest request) { try (DbSession dbSession = dbClient.openSession(false)) { OrganizationDto organization = getOrganization(dbSession, request); ComponentQuery esQuery = buildEsQuery(organization, request); SearchIdResult<String> results = componentIndex.search(esQuery, new SearchOptions().setPage(request.getPage(), request.getPageSize())); List<ComponentDto> components = dbClient.componentDao().selectByUuids(dbSession, results.getIds()); Map<String, String> projectKeysByUuids = searchProjectsKeysByUuids(dbSession, components); return buildResponse(components, organization, projectKeysByUuids, Paging.forPageIndex(request.getPage()).withPageSize(request.getPageSize()).andTotal((int) results.getTotal())); } }