mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 05:53:08 +00:00
DS-4166 community feedback: postpone support for highlighting over authority controlled metadata
This commit is contained in:
@@ -186,13 +186,10 @@ public class DiscoverResult {
|
|||||||
public static final class IndexableObjectHighlightResult {
|
public static final class IndexableObjectHighlightResult {
|
||||||
private IndexableObject indexableObject;
|
private IndexableObject indexableObject;
|
||||||
private Map<String, List<String>> highlightResults;
|
private Map<String, List<String>> highlightResults;
|
||||||
private Map<String, List<String[]>> highlightResultsWithAuthority;
|
|
||||||
|
|
||||||
public IndexableObjectHighlightResult(IndexableObject idxObj, Map<String, List<String>> highlightResults,
|
public IndexableObjectHighlightResult(IndexableObject idxObj, Map<String, List<String>> highlightResults) {
|
||||||
Map<String, List<String[]>> highlightResultsWithAuthority) {
|
|
||||||
this.indexableObject = idxObj;
|
this.indexableObject = idxObj;
|
||||||
this.highlightResults = highlightResults;
|
this.highlightResults = highlightResults;
|
||||||
this.highlightResultsWithAuthority = highlightResultsWithAuthority;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -215,17 +212,6 @@ public class DiscoverResult {
|
|||||||
return highlightResults.get(metadataKey);
|
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
|
* All the matching snippets in whatever metadata ignoring any authority value
|
||||||
*
|
*
|
||||||
|
@@ -2107,7 +2107,6 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
|||||||
if (MapUtils.isNotEmpty(highlightedFields)) {
|
if (MapUtils.isNotEmpty(highlightedFields)) {
|
||||||
//We need to remove all the "_hl" appendix strings from our keys
|
//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>> resultMap = new HashMap<String, List<String>>();
|
||||||
Map<String, List<String[]>> resultMapWithAuthority = new HashMap<String, List<String[]>>();
|
|
||||||
for (String key : highlightedFields.keySet()) {
|
for (String key : highlightedFields.keySet()) {
|
||||||
List<String> highlightOriginalValue = highlightedFields.get(key);
|
List<String> highlightOriginalValue = highlightedFields.get(key);
|
||||||
List<String[]> resultHighlightOriginalValue = new ArrayList<String[]>();
|
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));
|
resultMap.put(key.substring(0, key.lastIndexOf("_hl")), highlightedFields.get(key));
|
||||||
resultMapWithAuthority
|
|
||||||
.put(key.substring(0, key.lastIndexOf("_hl")), resultHighlightOriginalValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
result.addHighlightedResult(dso,
|
result.addHighlightedResult(dso,
|
||||||
new DiscoverResult.IndexableObjectHighlightResult(dso, resultMap, resultMapWithAuthority));
|
new DiscoverResult.IndexableObjectHighlightResult(dso, resultMap));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user