This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 1a8e904c authored by eduardDeploy's avatar eduardDeploy
Browse files

Merge branch '353-warning_from_logfile' into keycloak_theme

parents 14e22eb5 9a04ca49
Branches
3 merge requests!166Deploying Februrar 23 Release,!158Keycloak theme,!146Put the sonar-analyze job into a separate stage
......@@ -286,8 +286,8 @@ public class MetaDataRepository {
tryNextPage = searchResponse.getHits().getHits().length > 0;
for (SearchHit searchHit : searchResponse.getHits().getHits()) {
final String sourceAsJSON = searchHit.getSourceAsString();
SearchResultDTO entry = objectMapper.readValue(sourceAsJSON, SearchResultDTO.class);
final String sourceAsString = filterDateString(searchHit.getSourceAsString());
SearchResultDTO entry = objectMapper.readValue(sourceAsString, SearchResultDTO.class);
if (entry.getMetadata().getKeyword() != null) {
for (String keyWord : entry.getMetadata().getKeyword()) {
addTo(reloadedCachedCompletions.get(SearchRepositoryConstants.METADATA_KEYWORDS), split(keyWord), keyWord);
......@@ -330,6 +330,12 @@ public class MetaDataRepository {
cachedCompletions = reloadedCachedCompletions;
}
public static String filterDateString(String sourceAsJSON) {
String result = sourceAsJSON.replaceAll("[+-]\\d{2}:\\d{2}", "");
return result;
}
/**
* returns a preconfigured object mapper
*
......@@ -683,7 +689,8 @@ public class MetaDataRepository {
}
private static SearchResultDTO parseSearchHit(SearchHit searchHit, ObjectMapper objectMapper) throws JsonProcessingException {
final SearchResultDTO mappedValue = objectMapper.readValue(searchHit.getSourceAsString(), SearchResultDTO.class);
String sourceAsString = filterDateString(searchHit.getSourceAsString());
final SearchResultDTO mappedValue = objectMapper.readValue(sourceAsString, SearchResultDTO.class);
mappedValue.setExerciseId(searchHit.getId());
return mappedValue;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment