Search in sources :

Example 1 with SearchExpertListDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.SearchExpertListDTO in project ArachneCentralAPI by OHDSI.

the class BaseExpertFinderController method list.

@ApiOperation("Get expert list")
@RequestMapping(value = "/api/v1/user-management/users", method = GET)
public JsonResult<ExpertListSearchResultDTO> list(@ModelAttribute SearchExpertListDTO searchDTO) throws IOException, SolrServerException, NoSuchFieldException {
    JsonResult result = new JsonResult<ExpertListSearchResultDTO>(NO_ERROR);
    SolrQuery solrQuery = conversionService.convert(searchDTO, SolrQuery.class);
    SearchResult searchResult = userService.search(solrQuery);
    result.setResult(this.conversionService.convert(searchResult, ExpertListSearchResultDTO.class));
    return result;
}
Also used : ExpertListSearchResultDTO(com.odysseusinc.arachne.portal.api.v1.dto.ExpertListSearchResultDTO) SearchResult(com.odysseusinc.arachne.portal.service.impl.solr.SearchResult) JsonResult(com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult) SolrQuery(org.apache.solr.client.solrj.SolrQuery) ApiOperation(io.swagger.annotations.ApiOperation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with SearchExpertListDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.SearchExpertListDTO in project ArachneCentralAPI by OHDSI.

the class BaseUserServiceImpl method getExcludedOptions.

private Map<String, List<String>> getExcludedOptions() throws IOException, SolrServerException, NoSuchFieldException {
    SolrQuery solrQuery = conversionService.convert(new SearchExpertListDTO(true), SolrQuery.class);
    QueryResponse solrResponse = solrSearch(solrQuery);
    SearchResult<Long> searchResult = new SearchResult<>(solrQuery, solrResponse, Collections.<Long>emptyList());
    return searchResult.excludedOptions();
}
Also used : QueryResponse(org.apache.solr.client.solrj.response.QueryResponse) SearchResult(com.odysseusinc.arachne.portal.service.impl.solr.SearchResult) SearchExpertListDTO(com.odysseusinc.arachne.portal.api.v1.dto.SearchExpertListDTO) SolrQuery(org.apache.solr.client.solrj.SolrQuery)

Aggregations

SearchResult (com.odysseusinc.arachne.portal.service.impl.solr.SearchResult)2 SolrQuery (org.apache.solr.client.solrj.SolrQuery)2 JsonResult (com.odysseusinc.arachne.commons.api.v1.dto.util.JsonResult)1 ExpertListSearchResultDTO (com.odysseusinc.arachne.portal.api.v1.dto.ExpertListSearchResultDTO)1 SearchExpertListDTO (com.odysseusinc.arachne.portal.api.v1.dto.SearchExpertListDTO)1 ApiOperation (io.swagger.annotations.ApiOperation)1 QueryResponse (org.apache.solr.client.solrj.response.QueryResponse)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1