Examples of scorer()


Examples of org.apache.lucene.search.Weight.scorer()

        // Sort drill-downs by most restrictive first:
        Arrays.sort(dims);

        // TODO: it could be better if we take acceptDocs
        // into account instead of baseScorer?
        Scorer baseScorer = baseWeight.scorer(context, scoreDocsInOrder, false, acceptDocs);

        if (baseScorer == null) {
          return null;
        }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerSkipTo1() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.createWeight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader());
    assertEquals(true, s.skipTo(1));
    assertEquals(1, s.doc());
  }
  /**
   * not a direct test of NearSpans, but a demonstration of how/when
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerExplain() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.createWeight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader());
    Explanation e = s.explain(1);
    assertTrue("Scorer explanation value for doc#1 isn't positive: "
               + e.toString(),
               0.0f < e.getValue());
  }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    while(iter.hasNext()) {
      Entry entry = (Entry) iter.next();
      Query query = (Query) entry.getKey();
      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader);
      while(scorer.next()) {
        final int docID = scorer.doc();
        if (docIDStart + docID >= limit)
          break;
        reader.deleteDocument(docID);
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

        // Sort drill-downs by most restrictive first:
        Arrays.sort(dims);

        // TODO: it could be better if we take acceptDocs
        // into account instead of baseScorer?
        Scorer baseScorer = baseWeight.scorer(context, scoreDocsInOrder, false, acceptDocs);

        if (baseScorer == null) {
          return null;
        }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

            List<Query> filters = rb.getFilters();
            if (filters!=null){
              final ArrayList<DocIdSet> docsets = new ArrayList<DocIdSet>(filters.size());
                for (Query filter : filters){
                  Weight weight = filter.createWeight(rb.req.getSearcher());
                  final Scorer scorer = weight.scorer(reader, false, true);
                  docsets.add(new DocIdSet(){
                @Override
                public DocIdSetIterator iterator() throws IOException {
                  return scorer;
                }
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

      @Override
      public BulkScorer bulkScorer(AtomicReaderContext context, boolean scoreDocsInOrder, Bits acceptDocs) throws IOException {

        // TODO: it could be better if we take acceptDocs
        // into account instead of baseScorer?
        Scorer baseScorer = baseWeight.scorer(context, acceptDocs);

        DrillSidewaysScorer.DocsAndCost[] dims = new DrillSidewaysScorer.DocsAndCost[drillDowns.length];
        int nullCount = 0;
        for(int dim=0;dim<dims.length;dim++) {
          dims[dim] = new DrillSidewaysScorer.DocsAndCost();
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

  public void testSpanNearScorerSkipTo1() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = searcher.createNormalizedWeight(q);
    IndexReaderContext topReaderContext = searcher.getTopReaderContext();
    AtomicReaderContext leave = topReaderContext.leaves().get(0);
    Scorer s = w.scorer(leave, leave.reader().getLiveDocs());
    assertEquals(1, s.advance(1));
  }
 
  /**
   * not a direct test of NearSpans, but a demonstration of how/when
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

    while(iter.hasNext()) {
      Entry entry = (Entry) iter.next();
      Query query = (Query) entry.getKey();
      int limit = ((Integer) entry.getValue()).intValue();
      Weight weight = query.weight(searcher);
      Scorer scorer = weight.scorer(reader);
      while(scorer.next()) {
        final int docID = scorer.doc();
        if (docIDStart + docID >= limit)
          break;
        reader.deleteDocument(docID);
View Full Code Here

Examples of org.apache.lucene.search.Weight.scorer()

   * this causes problems
   */
  public void testSpanNearScorerSkipTo1() throws Exception {
    SpanNearQuery q = makeQuery();
    Weight w = q.createWeight(searcher);
    Scorer s = w.scorer(searcher.getIndexReader());
    assertEquals(true, s.skipTo(1));
    assertEquals(1, s.doc());
  }
  /**
   * not a direct test of NearSpans, but a demonstration of how/when
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.