当前位置: 首页>>代码示例>>Java>>正文


Java SearchParameters.setBulkFetchEnabled方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.search.SearchParameters.setBulkFetchEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java SearchParameters.setBulkFetchEnabled方法的具体用法?Java SearchParameters.setBulkFetchEnabled怎么用?Java SearchParameters.setBulkFetchEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.search.SearchParameters的用法示例。


在下文中一共展示了SearchParameters.setBulkFetchEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHighlight

import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
@Test
public void testHighlight() throws Exception
{
    SearchParameters sp = new SearchParameters();
    sp.setBulkFetchEnabled(false);
    GeneralHighlightParameters highlightParameters = new GeneralHighlightParameters(null,null,null,null,null,null,null,null);
    sp.setHighlight(highlightParameters);
    assertNull(sp.getHighlight().getMergeContiguous());
    assertNull(sp.getHighlight().getFields());

    List<FieldHighlightParameters> fields = new ArrayList<>(2);
    fields.add(new FieldHighlightParameters(null, null, null, null, null,null));
    fields.add(new FieldHighlightParameters("myfield", null, null, null, "(",")"));
    highlightParameters = new GeneralHighlightParameters(1,2,null,null,null,50,true,fields);
    sp.setHighlight(highlightParameters);
    assertEquals(2,sp.getHighlight().getFields().size());
    assertEquals(true,sp.getHighlight().getUsePhraseHighlighter().booleanValue());
    assertEquals(1,sp.getHighlight().getSnippetCount().intValue());
    assertEquals(50,sp.getHighlight().getMaxAnalyzedChars().intValue());
    assertEquals(2,sp.getHighlight().getFragmentSize().intValue());
    assertEquals("myfield",sp.getHighlight().getFields().get(1).getField());
    assertEquals("(",sp.getHighlight().getFields().get(1).getPrefix());
    assertEquals(")",sp.getHighlight().getFields().get(1).getPostfix());
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:25,代码来源:ResultMapperTests.java

示例2: mockResultset

import org.alfresco.service.cmr.search.SearchParameters; //导入方法依赖的package包/类
private ResultSet mockResultset(List<Long> archivedNodes, List<Long> versionNodes) throws JSONException
{

    NodeService nodeService = mock(NodeService.class);
    when(nodeService.getNodeRef(any())).thenAnswer(new Answer<NodeRef>() {
        @Override
        public NodeRef answer(InvocationOnMock invocation) throws Throwable {
            Object[] args = invocation.getArguments();
            //If the DBID is in the list archivedNodes, instead of returning a noderef return achivestore noderef
            if (archivedNodes.contains(args[0])) return new NodeRef(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE, GUID.generate());
            if (versionNodes.contains(args[0])) return new NodeRef(StoreMapper.STORE_REF_VERSION2_SPACESSTORE, GUID.generate()+args[0]);
            return new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, GUID.generate());
        }
    });

    SearchParameters sp = new SearchParameters();
    sp.setBulkFetchEnabled(false);
    JSONObject json = new JSONObject(new JSONTokener(JSON_REPONSE));
    ResultSet results = new SolrJSONResultSet(json,sp,nodeService, null, LimitBy.FINAL_SIZE, 10);
    return results;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:22,代码来源:ResultMapperTests.java

示例3: 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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:51,代码来源:CMISQueryOptions.java


注:本文中的org.alfresco.service.cmr.search.SearchParameters.setBulkFetchEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。