NIHVIVO-2847 - Added core:URLLink to set of prohibited classes.

This commit is contained in:
deepakkoni 2011-07-11 15:22:14 +00:00
parent d08e8ef6ce
commit be0a835b29

View file

@ -42,6 +42,8 @@ public class IndividualToSolrDocument {
private static List<String> contextNodeClassNames = new ArrayList<String>();
private static List<String> blackListedClasses = new ArrayList<String>();
public IndividualToSolrDocument(
ClassProhibitedFromSearch classesProhibitedFromSearch,
IndividualProhibitedFromSearch individualProhibitedFromSearch){
@ -59,9 +61,11 @@ public class IndividualToSolrDocument {
this.individualProhibitedFromSearch = individualProhibitedFromSearch;
this.documentModifiers = docModifiers;
fillContextNodes();
fillInBlackListedClasses();
}
@SuppressWarnings("static-access")
@SuppressWarnings("static-access")
public SolrInputDocument translate(Individual ind) throws IndexingException{
try{
log.debug("translating " + ind.getURI());
@ -256,7 +260,7 @@ public class IndividualToSolrDocument {
continue;
} else if(clz.getURI().startsWith(OWL.NS)){
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of type " + clz.getURI() );
} else if(contextNodeClassNames.contains(superLclName)) { // check to see if context node is being indexed.
} else if(contextNodeClassNames.contains(superLclName) || blackListedClasses.contains(superLclName)) { // check to see if context node is being indexed.
throw new SkipIndividualException("not indexing " + ind.getURI() + " because of context node type " + clz.getURI() );
} else {
if( !prohibited && classesProhibitedFromSearch.isClassProhibitedFromSearch(clz.getURI()))
@ -355,8 +359,16 @@ public class IndividualToSolrDocument {
IndividualToSolrDocument.contextNodeClassNames.add("AdvisingRelationship");
IndividualToSolrDocument.contextNodeClassNames.add("Authorship");
IndividualToSolrDocument.contextNodeClassNames.add("AcademicDegree");
}
// bk392 : Ideally this needs to be removed and the check for a blacklisted class
// has to made by firing a query against the display model which contains
// blacklisted classes (grabbed from search.n3)
private void fillInBlackListedClasses() {
//class that needs to be excluded from search
IndividualToSolrDocument.blackListedClasses.add("URLLink");
}
public static float NAME_BOOST = 1.2F;