Package org.apache.lucene.search

Examples of org.apache.lucene.search.Scorer$ChildScorer


    }

    @Override
    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer, Bits acceptDocs)
        throws IOException {
      Scorer scorer = _weight.scorer(context, true, topScorer, acceptDocs);
      if (scorer == null) {
        return null;
      }
      if (!_executor.scorersAlreadyAdded(context)) {
        Scorer[] scorers = getScorers(context, true, topScorer, acceptDocs);
View Full Code Here


    }

    @Override
    public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
      // Pass scoreDocsInOrder true, topScorer false to our sub:
      final Scorer childScorer = childWeight.scorer(reader, true, false);

      if (childScorer == null) {
        // No matches
        return null;
      }

      final int firstChildDoc = childScorer.nextDoc();
      if (firstChildDoc == DocIdSetIterator.NO_MORE_DOCS) {
        // No matches
        return null;
      }
View Full Code Here

    @Override
    public Scorer scorer(AtomicReaderContext readerContext, boolean scoreDocsInOrder,
        boolean topScorer, Bits acceptDocs) throws IOException {

      // Pass scoreDocsInOrder true, topScorer false to our sub and the live docs:
      final Scorer childScorer = childWeight.scorer(readerContext, true, false, readerContext.reader().getLiveDocs());

      if (childScorer == null) {
        // No matches
        return null;
      }

      final int firstChildDoc = childScorer.nextDoc();
      if (firstChildDoc == DocIdSetIterator.NO_MORE_DOCS) {
        // No matches
        return null;
      }
View Full Code Here

      // Pass true for "scoresDocsInOrder", because we
      // require in-order scoring, even if caller does not,
      // since we call advance on the valSrcScorers.  Pass
      // false for "topScorer" because we will not invoke
      // score(Collector) on these scorers:
      Scorer subQueryScorer = subQueryWeight.scorer(context, true, false, acceptDocs);
      if (subQueryScorer == null) {
        return null;
      }
      Scorer[] valSrcScorers = new Scorer[valSrcWeights.length];
      for(int i = 0; i < valSrcScorers.length; i++) {
View Full Code Here

    @Override
    public Scorer scorer(AtomicReaderContext readerContext, boolean scoreDocsInOrder,
        boolean topScorer, Bits acceptDocs) throws IOException {

      // Pass scoreDocsInOrder true, topScorer false to our sub:
      final Scorer parentScorer = parentWeight.scorer(readerContext, true, false, null);

      if (parentScorer == null) {
        // No matches
        return null;
      }
View Full Code Here

        // 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

   * 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());
  }
View Full Code Here

   * 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

                starts[i] = maxDoc;
                maxDoc += readers[i].maxDoc();
            }

            starts[readers.length] = maxDoc;
            Scorer scorers[] = new Scorer[readers.length];
            for (int i = 0; i < readers.length; i++)
                scorers[i] = scorer(readers[i]);

            return new MultiScorer(searcher.getSimilarity(), scorers, starts);
        } else {
View Full Code Here

      }
    }

    /*(non-Javadoc) @see org.apache.lucene.search.Weight#scorer(org.apache.lucene.index.IndexReader) */
    public Scorer scorer(IndexReader reader) throws IOException {
      Scorer subQueryScorer = subQueryWeight.scorer(reader);
      Scorer valSrcScorer = (valSrcWeight==null ? null : valSrcWeight.scorer(reader));
      return new CustomScorer(getSimilarity(searcher), reader, this, subQueryScorer, valSrcScorer);
    }
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.Scorer$ChildScorer

Copyright © 2018 www.massapicom. 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.