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


Java PagingLuceneResultSet类代码示例

本文整理汇总了Java中org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet的典型用法代码示例。如果您正苦于以下问题:Java PagingLuceneResultSet类的具体用法?Java PagingLuceneResultSet怎么用?Java PagingLuceneResultSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PagingLuceneResultSet类属于org.alfresco.repo.search.impl.lucene包,在下文中一共展示了PagingLuceneResultSet类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decide

import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet; //导入依赖的package包/类
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
        throws AccessDeniedException

{
    Map<Set<String>, ResultSet> map = returnedObject.getResults();
    Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f);

    for (Set<String> group : map.keySet())
    {
        ResultSet raw = map.get(group);
        ResultSet permed;
        if (PagingLuceneResultSet.class.isAssignableFrom(raw.getClass()))
        {
            permed = decide(authentication, object, config, (PagingLuceneResultSet)raw);
        }
        else
        {
            permed = decide(authentication, object, config, raw);
        }
        answer.put(group, permed);
    }
    return new QueryEngineResults(answer);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:ACLEntryAfterInvocationProvider.java

示例2: filterNotExistingNodes

import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet; //导入依赖的package包/类
private ResultSet filterNotExistingNodes(ResultSet resultSet)
{
    if (resultSet instanceof PagingLuceneResultSet)
    {
        ResultSet wrapped = ((PagingLuceneResultSet)resultSet).getWrapped();
        
        if (wrapped instanceof FilteringResultSet)
        {
            FilteringResultSet filteringResultSet = (FilteringResultSet)wrapped;
            
            for (int i = 0; i < filteringResultSet.length(); i++)
            {
                NodeRef nodeRef = filteringResultSet.getNodeRef(i);
                /* filter node if it does not exist */
                if (!nodeService.exists(nodeRef))
                {
                    filteringResultSet.setIncluded(i, false);
                }
            }
        }
    }
    
    return resultSet;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:CMISQueryServiceImpl.java

示例3: decide

import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet; //导入依赖的package包/类
private QueryEngineResults decide(Authentication authentication, Object object, ConfigAttributeDefinition config, QueryEngineResults returnedObject)
{
    Map<Set<String>, ResultSet> map = returnedObject.getResults();
    Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>(map.size(), 1.0f);

    for (Map.Entry<Set<String>, ResultSet> entry : map.entrySet())
    {
        ResultSet raw = entry.getValue();
        ResultSet permed;
        if (PagingLuceneResultSet.class.isAssignableFrom(raw.getClass()))
        {
            permed = decide(authentication, object, config, (PagingLuceneResultSet) raw);
        }
        else
        {
            permed = decide(authentication, object, config, raw);
        }
        answer.put(entry.getKey(), permed);
    }

    return new QueryEngineResults(answer);
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:23,代码来源:RMAfterInvocationProvider.java

示例4: executeQuery

import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet; //导入依赖的package包/类
@Override
public QueryEngineResults executeQuery(Query query, QueryOptions options, FunctionEvaluationContext functionContext)
{
    Set<String> selectorGroup = null;
    if (query.getSource() != null)
    {
        List<Set<String>> selectorGroups = query.getSource().getSelectorGroups(functionContext);

        if (selectorGroups.size() == 0)
        {
            throw new QueryModelException("No selectors");
        }

        if (selectorGroups.size() > 1)
        {
            throw new QueryModelException("Advanced join is not supported");
        }

        selectorGroup = selectorGroups.get(0);
    }

    
    HashSet<String> key = new HashSet<String>();
    key.add("");
    Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>();
    DBQuery dbQuery = (DBQuery)query;
    
    if(options.getStores().size() > 1)
    {
        throw new QueryModelException("Multi-store queries are not supported");
    }
    
    // MT
    StoreRef storeRef = options.getStores().get(0);
    storeRef = storeRef != null ? tenantService.getName(storeRef) : null;

    Pair<Long, StoreRef> store = nodeDAO.getStore(storeRef);
    if(store == null)
    {
    	  throw new QueryModelException("Unknown store: "+storeRef);
    }
    dbQuery.setStoreId(store.getFirst());
    Pair<Long, QName> sysDeletedType = qnameDAO.getQName(ContentModel.TYPE_DELETED);
    if(sysDeletedType == null)
    {
        dbQuery.setSysDeletedType(-1L);
    }
    else
    {
        dbQuery.setSysDeletedType(sysDeletedType.getFirst());
    }
    
    Long sinceTxId = options.getSinceTxId();
    if (sinceTxId == null)
    {
        // By default, return search results for all transactions.
        sinceTxId = -1L;
    }
    dbQuery.setSinceTxId(sinceTxId);
    
    dbQuery.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectorGroup, null, functionContext, metadataIndexCheck2.getPatchApplied());
    List<Node> nodes = template.selectList(SELECT_BY_DYNAMIC_QUERY, dbQuery);
    LinkedHashSet<Long> set = new LinkedHashSet<Long>(nodes.size());
    for(Node node : nodes)
    {
        set.add(node.getId());
    }
    List<Long> nodeIds = new ArrayList<Long>(set);
    ResultSet rs =  new DBResultSet(options.getAsSearchParmeters(), nodeIds, nodeDAO, nodeService, tenantService, Integer.MAX_VALUE);
    ResultSet paged = new PagingLuceneResultSet(rs, options.getAsSearchParmeters(), nodeService);
    
    answer.put(key, paged);
    return new QueryEngineResults(answer);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:75,代码来源:DBQueryEngine.java

示例5: executeQuery

import org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet; //导入依赖的package包/类
@Override
public QueryEngineResults executeQuery(Query query, QueryOptions options, FunctionEvaluationContext functionContext)
{
    Set<String> selectorGroup = null;
    if (query.getSource() != null)
    {
        List<Set<String>> selectorGroups = query.getSource().getSelectorGroups(functionContext);

        if (selectorGroups.size() == 0)
        {
            throw new QueryModelException("No selectors");
        }

        if (selectorGroups.size() > 1)
        {
            throw new QueryModelException("Advanced join is not supported");
        }

        selectorGroup = selectorGroups.get(0);
    }

    
    HashSet<String> key = new HashSet<String>();
    key.add("");
    Map<Set<String>, ResultSet> answer = new HashMap<Set<String>, ResultSet>();
    DBQuery dbQuery = (DBQuery)query;
    
    if(options.getStores().size() > 1)
    {
        throw new QueryModelException("Multi-store queries are not supported");
    }
    
    // MT
    StoreRef storeRef = options.getStores().get(0);
    storeRef = storeRef != null ? tenantService.getName(storeRef) : null;

    dbQuery.setStoreId(nodeDAO.getStore(storeRef).getFirst());
    Pair<Long, QName> sysDeletedType = qnameDAO.getQName(ContentModel.TYPE_DELETED);
    if(sysDeletedType == null)
    {
        dbQuery.setSysDeletedType(-1L);
    }
    else
    {
        dbQuery.setSysDeletedType(sysDeletedType.getFirst());
    }
    
    Long sinceTxId = options.getSinceTxId();
    if (sinceTxId == null)
    {
        // By default, return search results for all transactions.
        sinceTxId = -1L;
    }
    dbQuery.setSinceTxId(sinceTxId);
    
    dbQuery.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectorGroup, null, functionContext, metadataIndexCheck2.getPatchApplied());
    List<Node> nodes = template.selectList(SELECT_BY_DYNAMIC_QUERY, dbQuery);
    LinkedHashSet<Long> set = new LinkedHashSet<Long>(nodes.size());
    for(Node node : nodes)
    {
        set.add(node.getId());
    }
    List<Long> nodeIds = new ArrayList<Long>(set);
    ResultSet rs =  new DBResultSet(options.getAsSearchParmeters(), nodeIds, nodeDAO, nodeService, tenantService, Integer.MAX_VALUE);
    ResultSet paged = new PagingLuceneResultSet(rs, options.getAsSearchParmeters(), nodeService);
    
    answer.put(key, paged);
    return new QueryEngineResults(answer);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:70,代码来源:DBQueryEngine.java


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