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


Java DocSet.size方法代码示例

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


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

示例1: getDocSetSize

import org.apache.solr.search.DocSet; //导入方法依赖的package包/类
@Override
public int getDocSetSize(String targetTxId, String targetTxCommitTime) throws IOException
{
    RefCounted<SolrIndexSearcher> refCounted = null;
    try
    {
        refCounted = core.getSearcher(false, true, null);
        SolrIndexSearcher solrIndexSearcher = refCounted.get();
        BooleanQuery query = new BooleanQuery();
        query.add(new TermQuery(new Term(QueryConstants.FIELD_TXID, targetTxId)), Occur.MUST);
        query.add(new TermQuery(new Term(QueryConstants.FIELD_TXCOMMITTIME, targetTxCommitTime)), Occur.MUST);
        DocSet set = solrIndexSearcher.getDocSet(query);

        return set.size();
    }
    finally
    {
        if (refCounted != null)
        {
            refCounted.decref();
        }
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:24,代码来源:LegacySolrInformationServer.java

示例2: visitTerm

import org.apache.solr.search.DocSet; //导入方法依赖的package包/类
@Override
protected void visitTerm(TermsEnum te, int termNum) throws IOException {

  if (termNum >= maxTermCounts.length) {
    // resize by doubling - for very large number of unique terms, expanding
    // by 4K and resultant GC will dominate uninvert times.  Resize at end if material
    int[] newMaxTermCounts = new int[maxTermCounts.length*2];
    System.arraycopy(maxTermCounts, 0, newMaxTermCounts, 0, termNum);
    maxTermCounts = newMaxTermCounts;
  }

  final BytesRef term = te.term();

  if (te.docFreq() > maxTermDocFreq) {
    TopTerm topTerm = new TopTerm();
    topTerm.term = BytesRef.deepCopyOf(term);
    topTerm.termNum = termNum;
    bigTerms.put(topTerm.termNum, topTerm);

    if (deState == null) {
      deState = new SolrIndexSearcher.DocsEnumState();
      deState.fieldName = field;
      deState.liveDocs = searcher.getAtomicReader().getLiveDocs();
      deState.termsEnum = te;  // TODO: check for MultiTermsEnum in SolrIndexSearcher could now fail?
      deState.docsEnum = docsEnum;
      deState.minSetSizeCached = maxTermDocFreq;
    }

    docsEnum = deState.docsEnum;
    DocSet set = searcher.getDocSet(deState);
    maxTermCounts[termNum] = set.size();
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:34,代码来源:UnInvertedField.java


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