findSites() catches LuceneQueryParserException, logs it but supresses it from the user. ACE-1513

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@68308 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2014-04-30 10:00:58 +00:00
parent ff9cbfba1f
commit f7ce3590b6

View File

@@ -58,6 +58,7 @@ import org.alfresco.repo.node.getchildren.GetChildrenCannedQueryFactory;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.policy.JavaBehaviour;
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.search.impl.lucene.LuceneQueryParserException;
import org.alfresco.repo.security.authentication.AuthenticationContext;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
@@ -111,7 +112,6 @@ import org.json.JSONObject;
import org.springframework.context.ApplicationEvent;
import org.springframework.extensions.surf.util.AbstractLifecycleBean;
import org.springframework.extensions.surf.util.ParameterCheck;
import org.springframework.util.StringUtils;
/**
* Site Service Implementation. Also bootstraps the site AVM and DM stores.
@@ -882,18 +882,25 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
logger.debug("Search parameters are: " + sp);
}
ResultSet results = this.searchService.query(sp);
ResultSet results = null;
try
{
results = this.searchService.query(sp);
result = new ArrayList<SiteInfo>(results.length());
for (NodeRef site : results.getNodeRefs())
{
result.add(createSiteInfo(site));
}
}
catch (LuceneQueryParserException lqpe)
{
//Log the error but suppress is from the user
logger.error("LuceneQueryParserException with findSites()", lqpe);
result = Collections.emptyList();
}
finally
{
results.close();
if (results != null) results.close();
}
}