diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/LegacySearchController.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/LegacySearchController.java index 6c5e853..c26bf84 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/LegacySearchController.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/LegacySearchController.java @@ -2,6 +2,8 @@ import edu.harvard.dbmi.avillach.dictionary.legacysearch.model.LegacyResponse; import edu.harvard.dbmi.avillach.dictionary.legacysearch.model.LegacySearchQuery; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; @@ -13,6 +15,7 @@ @Controller public class LegacySearchController { + private static final Logger log = LoggerFactory.getLogger(LegacySearchController.class); private final LegacySearchService legacySearchService; @Autowired @@ -22,6 +25,7 @@ public LegacySearchController(LegacySearchService legacySearchService) { @RequestMapping(path = "/search") public ResponseEntity legacySearch(@RequestBody String jsonString) throws IOException { + log.info("legacySearch(): {}", jsonString); LegacySearchQuery legacySearchQuery = LegacySearchQueryMapper.mapFromJson(jsonString); return ResponseEntity .ok(new LegacyResponse(legacySearchService.getSearchResults(legacySearchQuery.filter(), legacySearchQuery.pageable()))); diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java index 7bac7ea..1ec7c21 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java @@ -54,8 +54,8 @@ private SearchResult mapSearchResults(ResultSet rs) throws SQLException { Result result = new Result( metadata, jsonBlobParser.parseValues(rs.getString("values")), rs.getString("dataset"), - rs.getString("parentName").isBlank() ? "All Variables" : rs.getString("parentName"), rs.getString("name"), - "categorical".equalsIgnoreCase(rs.getString("conceptType")), isContinuous + rs.getString("parentName") != null && rs.getString("parentName").isBlank() ? "All Variables" : rs.getString("parentName"), + rs.getString("name"), "categorical".equalsIgnoreCase(rs.getString("conceptType")), isContinuous ); return new SearchResult(result);