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

Skip to content
Snippets Groups Projects

Resolve "Relevance Ranking in Metadata"

Merged Philipp Gritsch requested to merge 439-relevance-ranking-in-metadata into development
Files
3
@@ -311,7 +311,7 @@ public class MetaDataRepository {
}
});
reloadedCachedCompletions.values().forEach(c -> simplify(c));
reloadedCachedCompletions.values().forEach(this::simplify);
cachedCompletions = reloadedCachedCompletions;
} catch (co.elastic.clients.elasticsearch._types.ElasticsearchException | ElasticsearchException | ConnectException ex) {
// this may happen mainly during testing, when
@@ -336,7 +336,7 @@ public class MetaDataRepository {
entries.forEach((lowerCaseValue, upperCaseValues) -> {
final Optional<Entry<String, Integer>> max = upperCaseValues.entrySet().stream().max((e1, e2) -> e1.getValue() - e2.getValue());
max.ifPresent(maxEntry -> {
int sum = upperCaseValues.entrySet().stream().mapToInt(o -> o.getValue()).sum();
int sum = upperCaseValues.entrySet().stream().mapToInt(Entry::getValue).sum();
entries.put(lowerCaseValue, Collections.singletonMap(maxEntry.getKey(), sum));
});
});