本文整理汇总了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();
}
}
}
示例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();
}
}