本文整理汇总了Java中org.alfresco.service.cmr.search.SearchParameters.setQueryConsistency方法的典型用法代码示例。如果您正苦于以下问题:Java SearchParameters.setQueryConsistency方法的具体用法?Java SearchParameters.setQueryConsistency怎么用?Java SearchParameters.setQueryConsistency使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.search.SearchParameters
的用法示例。
在下文中一共展示了SearchParameters.setQueryConsistency方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
public SearchParameters apply(ActualEnvironment environment, VirtualQuery query) throws VirtualizationException
{
SearchParameters searchParameters = new SearchParameters();
String storeRefString = query.getStoreRef();
if (storeRefString != null)
{
searchParameters.addStore(new StoreRef(storeRefString));
}
else
{
searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
}
searchParameters.setLanguage(query.getLanguage());
searchParameters.setQuery(query.getQueryString());
searchParameters.setQueryConsistency(QueryConsistency.TRANSACTIONAL_IF_POSSIBLE);
return searchParameters;
}
示例2: prepareSearchParameters
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Override
protected SearchParameters prepareSearchParameters(final WebScriptRequest req, final NodeRef archiveContextNode, final int pageSize,
final int startIndex)
{
final SearchParameters sp = new SearchParameters();
sp.addStore(archiveContextNode.getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
sp.setQueryConsistency(QueryConsistency.TRANSACTIONAL_IF_POSSIBLE);
final StringBuilder queryBuilder = new StringBuilder();
queryBuilder.append("PARENT:\"").append(archiveContextNode).append("\"");
sp.setQuery(queryBuilder.toString());
sp.setSkipCount(startIndex);
sp.setLimit(pageSize);
sp.setMaxItems(pageSize);
return sp;
}
示例3: createSearchParameters
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
private SearchParameters createSearchParameters(boolean files, boolean folders, PagingRequest pagingRequest)
throws VirtualizationException
{
SearchParameters searchParameters = new SearchParameters();
if (store != null)
{
searchParameters.addStore(new StoreRef(store));
}
else
{
searchParameters.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
}
searchParameters.setLanguage(language);
searchParameters.setQuery(filter(language,
query,
files,
folders));
searchParameters.setQueryConsistency(QueryConsistency.TRANSACTIONAL_IF_POSSIBLE);
if (pagingRequest != null)
{
searchParameters.setSkipCount(pagingRequest.getSkipCount());
searchParameters.setMaxItems(pagingRequest.getMaxItems());
}
return searchParameters;
}
示例4: queryWithCount
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
public void queryWithCount(String ql, String query, int count, QName property, Boolean ascending)
{
SearchParameters sp = new SearchParameters();
sp.setLanguage(ql);
sp.setQueryConsistency(QueryConsistency.TRANSACTIONAL);
sp.setQuery(query);
sp.addStore(rootNodeRef.getStoreRef());
ResultSet results = serviceRegistry.getSearchService().query(sp);
HashSet<NodeRef> found = new HashSet<NodeRef>();
Comparable last = null;
for(ResultSetRow row :results)
{
assertFalse(found.contains( row.getNodeRef()));
found.add(row.getNodeRef());
if(property != null)
{
Comparable current = (Comparable)nodeService.getProperty(row.getNodeRef(), property);
if(last != null)
{
if((ascending == null) || (ascending))
{
assert(last.compareTo(current) >= 0);
}
else
{
assert(last.compareTo(current) <= 0);
}
}
last = current;
}
}
assertEquals(count, results.length());
results.getResultSetMetaData();
results.close();
}
示例5: getAsSearchParmeters
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
/**
* @return SearchParameters
*/
public SearchParameters getAsSearchParmeters()
{
SearchParameters searchParameters = new SearchParameters();
searchParameters.setDefaultFieldName(this.getDefaultFieldName());
searchParameters.setDefaultFTSFieldConnective(this.getDefaultFTSFieldConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setDefaultFTSOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setDefaultOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO);
if(this.getMaxItems() > 0)
{
searchParameters.setLimit(this.getMaxItems());
searchParameters.setLimitBy(LimitBy.FINAL_SIZE);
searchParameters.setMaxItems(this.getMaxItems());
}
searchParameters.setMaxPermissionChecks(this.getMaxPermissionChecks());
searchParameters.setMaxPermissionCheckTimeMillis(this.getMaxPermissionCheckTimeMillis());
searchParameters.setMlAnalaysisMode(this.getMlAnalaysisMode());
//searchParameters.setNamespace() TODO: Fix
//searchParameters.setPermissionEvaluation()
searchParameters.setQuery(this.getQuery());
searchParameters.setSkipCount(this.getSkipCount());
//searchParameters.addAllAttribute()
for(Locale locale : this.getLocales())
{
searchParameters.addLocale(locale);
}
for(QueryParameterDefinition queryParameterDefinition: this.getQueryParameterDefinitions())
{
searchParameters.addQueryParameterDefinition(queryParameterDefinition);
}
//searchParameters.addQueryTemplate(name, template)
//searchParameters.addSort()
for(StoreRef storeRef : this.getStores())
{
searchParameters.addStore(storeRef);
}
//searchParameters.addTextAttribute()
searchParameters.setQueryConsistency(this.getQueryConsistency());
searchParameters.setSinceTxId(getSinceTxId());
for(String name : getQueryTemplates().keySet())
{
String template = getQueryTemplates().get(name);
searchParameters.addQueryTemplate(name, template);
}
return searchParameters;
}
示例6: getAsSearchParmeters
import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
/**
* @return SearchParameters
*/
public SearchParameters getAsSearchParmeters()
{
SearchParameters searchParameters = new SearchParameters();
searchParameters.setDefaultFieldName(this.getDefaultFieldName());
searchParameters.setDefaultFTSFieldConnective(this.getDefaultFTSFieldConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setDefaultFTSOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setDefaultOperator(this.getDefaultFTSConnective() == Connective.OR ? SearchParameters.Operator.OR : SearchParameters.Operator.AND);
searchParameters.setLanguage(SearchService.LANGUAGE_CMIS_ALFRESCO);
if(this.getMaxItems() > 0)
{
searchParameters.setLimit(this.getMaxItems());
searchParameters.setLimitBy(LimitBy.FINAL_SIZE);
searchParameters.setMaxItems(this.getMaxItems());
}
searchParameters.setMaxPermissionChecks(this.getMaxPermissionChecks());
searchParameters.setMaxPermissionCheckTimeMillis(this.getMaxPermissionCheckTimeMillis());
searchParameters.setMlAnalaysisMode(this.getMlAnalaysisMode());
//searchParameters.setNamespace() TODO: Fix
//searchParameters.setPermissionEvaluation()
searchParameters.setQuery(this.getQuery());
searchParameters.setSkipCount(this.getSkipCount());
//searchParameters.addAllAttribute()
for(Locale locale : this.getLocales())
{
searchParameters.addLocale(locale);
}
for(QueryParameterDefinition queryParameterDefinition: this.getQueryParameterDefinitions())
{
searchParameters.addQueryParameterDefinition(queryParameterDefinition);
}
//searchParameters.addQueryTemplate(name, template)
//searchParameters.addSort()
for(StoreRef storeRef : this.getStores())
{
searchParameters.addStore(storeRef);
}
//searchParameters.addTextAttribute()
searchParameters.setBulkFetchEnabled(isBulkFetchEnabled());
searchParameters.setQueryConsistency(this.getQueryConsistency());
searchParameters.setSinceTxId(getSinceTxId());
for(String name : getQueryTemplates().keySet())
{
String template = getQueryTemplates().get(name);
searchParameters.addQueryTemplate(name, template);
}
return searchParameters;
}