org.apache.lucene.search

Class ReqExclScorer


public class ReqExclScorer
extends Scorer

A Scorer for queries with a required subscorer and an excluding (prohibited) subscorer.
This Scorer implements Scorer.skipTo(int), and it uses the skipTo() on the given scorers.

Constructor Summary

ReqExclScorer(Scorer reqScorer, Scorer exclScorer)
Construct a ReqExclScorer.

Method Summary

int
doc()
Explanation
explain(int doc)
boolean
next()
float
score()
Returns the score of the current document matching the query.
boolean
skipTo(int target)
Skips to the first match beyond the current whose document number is greater than or equal to a given target.

Methods inherited from class org.apache.lucene.search.Scorer

doc, explain, getSimilarity, next, score, score, score, skipTo

Constructor Details

ReqExclScorer

public ReqExclScorer(Scorer reqScorer,
                     Scorer exclScorer)
Construct a ReqExclScorer.
Parameters:
reqScorer - The scorer that must match, except where
exclScorer - indicates exclusion.

Method Details

doc

public int doc()
Overrides:
doc in interface Scorer

explain

public Explanation explain(int doc)
            throws IOException
Overrides:
explain in interface Scorer

next

public boolean next()
            throws IOException
Overrides:
next in interface Scorer

score

public float score()
            throws IOException
Overrides:
score in interface Scorer
Returns:
The score of the required scorer.

skipTo

public boolean skipTo(int target)
            throws IOException
Overrides:
skipTo in interface Scorer
Parameters:
target - The target document number.
Returns:
true iff there is such a match.

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.