removing individuals from search index when they are inferred to be a prohibited type. NIHVIVO-824
This commit is contained in:
parent
2fc49b4ac8
commit
5d87f1b995
1 changed files with 7 additions and 4 deletions
|
@ -16,7 +16,6 @@ import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.VClassDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||||
|
@ -343,12 +342,16 @@ public class IndexBuilder {
|
||||||
for( VClass vclass : ind.getVClasses() ){
|
for( VClass vclass : ind.getVClasses() ){
|
||||||
if( classesProhibitedFromSearch.isClassProhibited(vclass.getURI()) ){
|
if( classesProhibitedFromSearch.isClassProhibited(vclass.getURI()) ){
|
||||||
prohibitedClass = true;
|
prohibitedClass = true;
|
||||||
|
log.debug("not indexing " + ind.getURI() + " because class " + vclass.getURI() + " is on prohibited list.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !prohibitedClass )
|
if( !prohibitedClass )
|
||||||
indexer.index(ind, newDoc);
|
indexer.index(ind, newDoc);
|
||||||
|
else
|
||||||
|
indexer.removeFromIndex(ind);
|
||||||
|
|
||||||
}catch(Throwable ex){
|
}catch(Throwable ex){
|
||||||
log.debug("IndexBuilder.indexItem() Error indexing "
|
log.debug("IndexBuilder.indexItem() Error indexing "
|
||||||
+ ind + "\n" +ex);
|
+ ind + "\n" +ex);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue