|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectQuery
SpanQuery
SpanRangeQuery
public class SpanRangeQuery
Matches spans containing terms within a specified range.
Field Summary | |
---|---|
private boolean |
inclusive
|
private Term |
lowerTerm
|
private int |
termLimit
|
private static int |
TERMS_TO_REPORT
Limit on the number of terms to report on an error |
private Term |
upperTerm
|
Constructor Summary | |
---|---|
SpanRangeQuery(Term lowerTerm,
Term upperTerm,
boolean inclusive)
Constructs a span query selecting all terms greater than lowerTerm but less than upperTerm . |
|
SpanRangeQuery(Term lowerTerm,
Term upperTerm,
boolean inclusive,
int termLimit)
Constructs a span query selecting all terms greater than lowerTerm but less than upperTerm . |
Method Summary | |
---|---|
Query |
combine(Query[] queries)
|
String |
getField()
Returns the field name for this query |
Term |
getLowerTerm()
Returns the lower term of this range query |
Spans |
getSpans(IndexReader reader,
Searcher searcher)
Should never be called on this query itself, only on the result of rewrite(IndexReader) . |
int |
getTermLimit()
Returns the term limit, if any, for this range query |
Collection |
getTerms()
Should never be called on this query itself, only on the result of rewrite(IndexReader) . |
Term |
getUpperTerm()
Returns the upper term of this range query |
boolean |
isInclusive()
Returns true if the range query is inclusive |
Query |
rewrite(IndexReader reader)
This method is actually the workhorse of the class. |
protected boolean |
shouldSkipTerm(Term t)
Enables derived classes to skip certain terms in the index (e.g. stop words, bi-grams, etc.) |
String |
toString(String field)
|
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 |
---|
private int termLimit
private Term lowerTerm
private Term upperTerm
private boolean inclusive
private static final int TERMS_TO_REPORT
Constructor Detail |
---|
public SpanRangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive)
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.
public SpanRangeQuery(Term lowerTerm, Term upperTerm, boolean inclusive, int termLimit)
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 |
---|
public Query rewrite(IndexReader reader) throws IOException
rewrite
in class Query
IOException
protected boolean shouldSkipTerm(Term t)
public Query combine(Query[] queries)
combine
in class Query
public String getField()
getField
in class SpanQuery
public Term getLowerTerm()
public Term getUpperTerm()
public boolean isInclusive()
true
if the range query is inclusive
public int getTermLimit()
public String toString(String field)
toString
in class Query
public Spans getSpans(IndexReader reader, Searcher searcher) throws IOException
rewrite(IndexReader)
.
getSpans
in class SpanQuery
IOException
public Collection getTerms()
rewrite(IndexReader)
.
getTerms
in class SpanQuery
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |