當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。