DS-4166 community feedback: postpone support for highlighting over authority controlled metadata

This commit is contained in:
Andrea Bollini
2019-04-16 22:37:02 +02:00
parent 84eabcbf91
commit 5338a88892
2 changed files with 2 additions and 19 deletions

View File

@@ -186,13 +186,10 @@ public class DiscoverResult {
public static final class IndexableObjectHighlightResult {
private IndexableObject indexableObject;
private Map<String, List<String>> highlightResults;
private Map<String, List<String[]>> highlightResultsWithAuthority;
public IndexableObjectHighlightResult(IndexableObject idxObj, Map<String, List<String>> highlightResults,
Map<String, List<String[]>> highlightResultsWithAuthority) {
public IndexableObjectHighlightResult(IndexableObject idxObj, Map<String, List<String>> highlightResults) {
this.indexableObject = idxObj;
this.highlightResults = highlightResults;
this.highlightResultsWithAuthority = highlightResultsWithAuthority;
}
/**
@@ -215,17 +212,6 @@ public class DiscoverResult {
return highlightResults.get(metadataKey);
}
/**
* The matching snippets for a specific metadata including the authority value if any
*
* @param metadataKey
* the metadata where the snippets have been found
* @return the matching snippets
*/
public List<String[]> getHighlightResultsWithAuthority(String metadataKey) {
return highlightResultsWithAuthority.get(metadataKey);
}
/**
* All the matching snippets in whatever metadata ignoring any authority value
*

View File

@@ -2107,7 +2107,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
if (MapUtils.isNotEmpty(highlightedFields)) {
//We need to remove all the "_hl" appendix strings from our keys
Map<String, List<String>> resultMap = new HashMap<String, List<String>>();
Map<String, List<String[]>> resultMapWithAuthority = new HashMap<String, List<String[]>>();
for (String key : highlightedFields.keySet()) {
List<String> highlightOriginalValue = highlightedFields.get(key);
List<String[]> resultHighlightOriginalValue = new ArrayList<String[]>();
@@ -2117,12 +2116,10 @@ public class SolrServiceImpl implements SearchService, IndexingService {
}
resultMap.put(key.substring(0, key.lastIndexOf("_hl")), highlightedFields.get(key));
resultMapWithAuthority
.put(key.substring(0, key.lastIndexOf("_hl")), resultHighlightOriginalValue);
}
result.addHighlightedResult(dso,
new DiscoverResult.IndexableObjectHighlightResult(dso, resultMap, resultMapWithAuthority));
new DiscoverResult.IndexableObjectHighlightResult(dso, resultMap));
}
}
}