类org.apache.lucene.search.ConjunctionDISI源码实例Demo

下面列出了怎么用org.apache.lucene.search.ConjunctionDISI的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lucene-solr   文件: LongValueFacetCounts.java
private void countOneSegment(NumericDocValues values, MatchingDocs hits) throws IOException {
  DocIdSetIterator it = ConjunctionDISI.intersectIterators(
                           Arrays.asList(hits.bits.iterator(), values));

  for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
    increment(values.longValue());
    totCount++;
  }
}
 
源代码2 项目: lucene-solr   文件: LongValueFacetCounts.java
/** Counts directly from SortedNumericDocValues. */
private void countMultiValued(String field, List<MatchingDocs> matchingDocs) throws IOException {

  for (MatchingDocs hits : matchingDocs) {
    SortedNumericDocValues values = hits.context.reader().getSortedNumericDocValues(field);
    if (values == null) {
      // this field has no doc values for this segment
      continue;
    }

    NumericDocValues singleValues = DocValues.unwrapSingleton(values);

    if (singleValues != null) {
      countOneSegment(singleValues, hits);
    } else {

      DocIdSetIterator it = ConjunctionDISI.intersectIterators(
                               Arrays.asList(hits.bits.iterator(), values));
    
      for (int doc = it.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = it.nextDoc()) {
        int limit = values.docValueCount();
        totCount += limit;
        for (int i = 0; i < limit; i++) {
          increment(values.nextValue());
        }
      }
    }
  }
}
 
源代码3 项目: lucene-solr   文件: ConjunctionSpans.java
ConjunctionSpans(List<Spans> subSpans) {
  if (subSpans.size() < 2) {
    throw new IllegalArgumentException("Less than 2 subSpans.size():" + subSpans.size());
  }
  this.subSpans = subSpans.toArray(new Spans[subSpans.size()]);
  this.conjunction = ConjunctionDISI.intersectSpans(subSpans);
  this.atFirstInCurrentDoc = true; // ensure for doc -1 that start/end positions are -1
}
 
源代码4 项目: pyramid   文件: CustomConjunctionSpans.java
CustomConjunctionSpans(List<Spans> subSpans) {
    if (subSpans.size() < 2) {
        throw new IllegalArgumentException("Less than 2 subSpans.size():" + subSpans.size());
    }
    this.subSpans = subSpans.toArray(new Spans[subSpans.size()]);
    this.conjunction = ConjunctionDISI.intersectSpans(subSpans);
    this.atFirstInCurrentDoc = true; // ensure for doc -1 that start/end positions are -1
}
 
源代码5 项目: lucene-solr   文件: ToParentDocValues.java
private ToParentDocValues(DocIdSetIterator values, BitSet parents, DocIdSetIterator children, Accumulator collect) {
  this.parents = parents;
  childWithValues = ConjunctionDISI.intersectIterators(Arrays.asList(children, values));
  this.collector = collect;
}
 
 类所在包
 类方法
 同包方法