org.apache.lucene.bigram
Class BigramSpanRangeQuery

Object
  extended by Query
      extended by SpanQuery
          extended by SpanRangeQuery
              extended by BigramSpanRangeQuery
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
XtfSpanRangeQuery

public class BigramSpanRangeQuery
extends SpanRangeQuery

Matches spans containing terms within a specified range. Performs extra filtering to make sure bi-grams are not matched.

See Also:
Serialized Form

Field Summary
private  Set stopSet
           
 
Constructor Summary
BigramSpanRangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive, int termLimit)
          Constructs a span query selecting all terms greater than lowerTerm but less than upperTerm.
 
Method Summary
 void setStopWords(Set set)
           
protected  boolean shouldSkipTerm(Term term)
          Enables derived classes to skip certain terms in the index (e.g. stop words, bi-grams, etc.)
 
Methods inherited from class SpanRangeQuery
combine, getField, getLowerTerm, getSpans, getTermLimit, getTerms, getUpperTerm, isInclusive, rewrite, toString
 
Methods inherited from class SpanQuery
createWeight, getSpanRecording, setSpanRecording
 
Methods inherited from class Query
clone, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stopSet

private Set stopSet
Constructor Detail

BigramSpanRangeQuery

public BigramSpanRangeQuery(Term lowerTerm,
                            Term upperTerm,
                            boolean inclusive,
                            int termLimit)
Constructs a span query selecting all terms greater than lowerTerm but less than upperTerm. There must be at least one term and either term may be null, in which case there is no bound on that side, but if there are two terms, both terms must be for the same field. Applies a limit on the total number of terms matched.

Method Detail

setStopWords

public void setStopWords(Set set)

shouldSkipTerm

protected boolean shouldSkipTerm(Term term)
Description copied from class: SpanRangeQuery
Enables derived classes to skip certain terms in the index (e.g. stop words, bi-grams, etc.) Default implementation doesn't skip any terms.

Overrides:
shouldSkipTerm in class SpanRangeQuery