mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
66625: Merged WAT2 (4.3/Cloud) to HEAD-BUG-FIX (4.3/Cloud) 64718: Merge of Live Search revs 59081-60158 from BRANCHES/DEV/KEVINR - pt1 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@66706 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,6 +39,7 @@ import org.alfresco.service.cmr.search.LimitBy;
|
|||||||
import org.alfresco.service.cmr.search.ResultSet;
|
import org.alfresco.service.cmr.search.ResultSet;
|
||||||
import org.alfresco.service.cmr.search.ResultSetRow;
|
import org.alfresco.service.cmr.search.ResultSetRow;
|
||||||
import org.alfresco.service.cmr.search.SearchParameters;
|
import org.alfresco.service.cmr.search.SearchParameters;
|
||||||
|
import org.alfresco.service.cmr.search.SearchParameters.Operator;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
import org.alfresco.service.cmr.security.AccessStatus;
|
import org.alfresco.service.cmr.security.AccessStatus;
|
||||||
import org.alfresco.service.cmr.security.PermissionService;
|
import org.alfresco.service.cmr.security.PermissionService;
|
||||||
@@ -499,6 +500,7 @@ public class Search extends BaseScopableProcessorExtension
|
|||||||
* page: object, optional, paging information object (see below) - if supported by the language
|
* page: object, optional, paging information object (see below) - if supported by the language
|
||||||
* namespace: string, optional, the default namespace for properties
|
* namespace: string, optional, the default namespace for properties
|
||||||
* defaultField: string, optional, the default field for query elements when not explicit in the query
|
* defaultField: string, optional, the default field for query elements when not explicit in the query
|
||||||
|
* defaultOperator: string,optional, the default operator for query elements when they are not explicit in the query AND or OR
|
||||||
* onerror: string optional, result on error - one of: exception, no-results - defaults to 'exception'
|
* onerror: string optional, result on error - one of: exception, no-results - defaults to 'exception'
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
@@ -557,6 +559,7 @@ public class Search extends BaseScopableProcessorExtension
|
|||||||
String namespace = (String)def.get("namespace");
|
String namespace = (String)def.get("namespace");
|
||||||
String onerror = (String)def.get("onerror");
|
String onerror = (String)def.get("onerror");
|
||||||
String defaultField = (String)def.get("defaultField");
|
String defaultField = (String)def.get("defaultField");
|
||||||
|
String defaultOperator = (String)def.get("defaultOperator");
|
||||||
|
|
||||||
// extract supplied values
|
// extract supplied values
|
||||||
|
|
||||||
@@ -642,6 +645,10 @@ public class Search extends BaseScopableProcessorExtension
|
|||||||
{
|
{
|
||||||
sp.setDefaultFieldName(defaultField);
|
sp.setDefaultFieldName(defaultField);
|
||||||
}
|
}
|
||||||
|
if (defaultOperator != null)
|
||||||
|
{
|
||||||
|
sp.setDefaultOperator(Operator.valueOf(defaultOperator.toUpperCase()));
|
||||||
|
}
|
||||||
if (namespace != null)
|
if (namespace != null)
|
||||||
{
|
{
|
||||||
sp.setNamespace(namespace);
|
sp.setNamespace(namespace);
|
||||||
@@ -799,8 +806,12 @@ public class Search extends BaseScopableProcessorExtension
|
|||||||
{
|
{
|
||||||
Collection<ScriptNode> set = null;
|
Collection<ScriptNode> set = null;
|
||||||
|
|
||||||
|
long time = 0L;
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
{
|
||||||
logger.debug("query=" + sp.getQuery() + " limit=" + (sp.getLimitBy() != LimitBy.UNLIMITED ? sp.getLimit() : "none"));
|
logger.debug("query=" + sp.getQuery() + " limit=" + (sp.getLimitBy() != LimitBy.UNLIMITED ? sp.getLimit() : "none"));
|
||||||
|
time = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
// perform the search against the repo
|
// perform the search against the repo
|
||||||
ResultSet results = null;
|
ResultSet results = null;
|
||||||
@@ -839,6 +850,8 @@ public class Search extends BaseScopableProcessorExtension
|
|||||||
{
|
{
|
||||||
results.close();
|
results.close();
|
||||||
}
|
}
|
||||||
|
if (logger.isDebugEnabled())
|
||||||
|
logger.debug("query time: " + (System.currentTimeMillis()-time) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
return set != null ? set.toArray(new Object[(set.size())]) : new Object[0];
|
return set != null ? set.toArray(new Object[(set.size())]) : new Object[0];
|
||||||
|
Reference in New Issue
Block a user