VIVO-869 Don't enter duplicate class group URIs in the search document.
This commit is contained in:
parent
b3564e31bd
commit
7f61b39311
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,9 @@ import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.RDFTY
|
|||
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.URI;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -161,6 +163,7 @@ public class UpdateDocumentWorkUnit implements Runnable {
|
|||
return;
|
||||
}
|
||||
|
||||
Set<String> classGroupUris = new HashSet<>();
|
||||
for (VClass clz : vclasses) {
|
||||
String classUri = clz.getURI();
|
||||
if (classUri == null || URI_OWL_THING.equals(classUri)) {
|
||||
|
@ -170,7 +173,7 @@ public class UpdateDocumentWorkUnit implements Runnable {
|
|||
|
||||
String classGroupUri = clz.getGroupURI();
|
||||
if (classGroupUri != null) {
|
||||
doc.addField(CLASSGROUP_URI, classGroupUri);
|
||||
classGroupUris.add(classGroupUri);
|
||||
}
|
||||
|
||||
addToAlltext(doc, clz.getName());
|
||||
|
@ -180,6 +183,9 @@ public class UpdateDocumentWorkUnit implements Runnable {
|
|||
doc.setDocumentBoost(doc.getDocumentBoost() + boost);
|
||||
}
|
||||
}
|
||||
if (!classGroupUris.isEmpty()) {
|
||||
doc.addField(CLASSGROUP_URI, classGroupUris);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue