From f1a56e5947bf220fb22157529d72267352ee6a53 Mon Sep 17 00:00:00 2001 From: briancaruso Date: Wed, 27 Jun 2012 17:36:18 +0000 Subject: [PATCH] Fixing bug with search exclusion --- .../search/solr/documentBuilding/ExcludeBasedOnType.java | 6 +++--- .../solr/documentBuilding/ExcludeBasedOnTypeTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnType.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnType.java index b2b6094bb..97c9c5aa6 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnType.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnType.java @@ -34,9 +34,9 @@ public class ExcludeBasedOnType implements SearchIndexExcluder { if( typeURIinExcludeList( ind.getVClass() )) return SKIP_MSG; - List vclasses = ind.getVClasses(); - if( vclasses == null) - return null; + List vclasses = new ArrayList(); + vclasses.addAll( ind.getVClasses()!=null?ind.getVClasses():Collections.EMPTY_LIST ); + vclasses.addAll( ind.getVClasses(true)!=null?ind.getVClasses(true):Collections.EMPTY_LIST ); for( VClass vclz : vclasses){ if( typeURIinExcludeList( vclz )) diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnTypeTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnTypeTest.java index 710cc01b7..908b62354 100644 --- a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnTypeTest.java +++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/solr/documentBuilding/ExcludeBasedOnTypeTest.java @@ -33,7 +33,7 @@ public class ExcludeBasedOnTypeTest { public void testCheckForExclusion2() { ExcludeBasedOnType ebot = new ExcludeBasedOnType(); - ebot.addTypeToExclude("http://xmlns.com/foaf/0.1/KillerRobot"); + ebot.addTypeToExclude("http://example.com/KillerRobot"); IndividualImpl ind = new IndividualImpl(); ind.setURI("http://example.com/n2343");